aboutsummaryrefslogtreecommitdiff
path: root/README.md
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 /README.md
parent3a8eb0de07814569f0bdadffc60dda1668de90bd (diff)
parent11123820fba8bbc52739252fb69b5e421fcbea3a (diff)
Merge pull request #58 from gorilla/elithrar/generaterandomkey-docs
[docs] Clarify usage of GenerateRandomKey
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 7 insertions, 5 deletions
diff --git a/README.md b/README.md
index aa7bd1a..a914d4a 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,9 @@
-securecookie
-============
+# securecookie
+
[![GoDoc](https://godoc.org/github.com/gorilla/securecookie?status.svg)](https://godoc.org/github.com/gorilla/securecookie) [![Build Status](https://travis-ci.org/gorilla/securecookie.png?branch=master)](https://travis-ci.org/gorilla/securecookie)
[![Sourcegraph](https://sourcegraph.com/github.com/gorilla/securecookie/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/securecookie?badge)
-
-securecookie encodes and decodes authenticated and optionally encrypted
+securecookie encodes and decodes authenticated and optionally encrypted
cookie values.
Secure cookies can't be forged, because their values are validated using HMAC.
@@ -33,7 +32,10 @@ to not use encryption. If set, the length must correspond to the block size
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.
-Strong keys can be created using the convenience function GenerateRandomKey().
+Strong keys can be created using the convenience function
+`GenerateRandomKey()`. 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.
Once a SecureCookie instance is set, use it to encode a cookie value: