Skip to content

Commit

Permalink
docs: fix CookieStore creation in doc.go (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
collinewait authored and elithrar committed Jan 5, 2020
1 parent 400b592 commit 15ff351
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc.go
Expand Up @@ -31,7 +31,7 @@ Let's start with an example that shows the sessions API in a nutshell:
// alongside your code. Ensure your key is sufficiently random - i.e. use Go's
// crypto/rand or securecookie.GenerateRandomKey(32) and persist the result.
// Ensure SESSION_KEY exists in the environment, or sessions will fail.
var store = sessions.NewCookieStore(os.Getenv("SESSION_KEY"))
var store = sessions.NewCookieStore([]byte(os.Getenv("SESSION_KEY")))
func MyHandler(w http.ResponseWriter, r *http.Request) {
// Get a session. Get() always returns a session, even if empty.
Expand Down

0 comments on commit 15ff351

Please sign in to comment.