aboutsummaryrefslogtreecommitdiff
path: root/securecookie.go
diff options
context:
space:
mode:
authorKamil Kisiel <kamil@kamilkisiel.net>2018-09-13 23:06:11 +0300
committerGitHub <noreply@github.com>2018-09-13 23:06:11 +0300
commitbb1ab76598893258e90f45d8a708a2505a95af2a (patch)
treea28d1262205f9d326815f2272a02716188d343d9 /securecookie.go
parent3a8eb0de07814569f0bdadffc60dda1668de90bd (diff)
parent11123820fba8bbc52739252fb69b5e421fcbea3a (diff)
Merge pull request #58 from gorilla/elithrar/generaterandomkey-docs
[docs] Clarify usage of GenerateRandomKey
Diffstat (limited to 'securecookie.go')
-rw-r--r--securecookie.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/securecookie.go b/securecookie.go
index 61af390..a34f851 100644
--- a/securecookie.go
+++ b/securecookie.go
@@ -506,6 +506,10 @@ func decode(value []byte) ([]byte, error) {
// GenerateRandomKey creates a random key with the given length in bytes.
// On failure, returns nil.
//
+// Note that keys created using `GenerateRandomKey()` are not automatically
+// persisted. New keys will be created when the application is restarted, and
+// previously issued cookies will not be able to be decoded.
+//
// Callers should explicitly check for the possibility of a nil return, treat
// it as a failure of the system random number generator, and not continue.
func GenerateRandomKey(length int) []byte {