aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Silverlock <matt@eatsleeprepeat.net>2015-08-08 14:19:02 +0300
committerMatt Silverlock <matt@eatsleeprepeat.net>2015-08-08 14:19:02 +0300
commit6d727f0c85dca64d111f5654c33c08f8162220dd (patch)
tree3bb22f76e2e1e037a3a367dfad770d0e56bdf8a5
parent7029a2efc7c689d58e885eb12374b23c578763f9 (diff)
Added note re: using GenerateRandomKey() not persisting keys.
-rw-r--r--securecookie.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/securecookie.go b/securecookie.go
index b1cb144..a776889 100644
--- a/securecookie.go
+++ b/securecookie.go
@@ -126,6 +126,10 @@ type Codec interface {
// of the encryption algorithm. For AES, used by default, valid lengths are
// 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.
// The default encoder used for cookie serialization is encoding/gob.
+//
+// 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.
func New(hashKey, blockKey []byte) *SecureCookie {
s := &SecureCookie{
hashKey: hashKey,