Skip to content

Commit

Permalink
update docs to reflect that you should update your signing key
Browse files Browse the repository at this point in the history
  • Loading branch information
syntaqx committed Jun 30, 2024
1 parent 9b36901 commit 0275f35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ if err != nil {

### Signing Key

By default, the signing key is set to `cookie.DefaultSigningKey`. If you want to
change the signing key, you can set it using the `cookie.SigningKey` variable:
By default, the signing key is set to `[]byte(cookie.DefaultSigningKey)`. You
should change this signing key for your application by assigning the
`cookie.SigningKey` variable to a secret value of your own:

```go
cookie.SigningKey = []byte("my-secret-key")
Expand Down
5 changes: 3 additions & 2 deletions cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ import (
)

const (
CookieTag = "cookie"
CookieTag = "cookie"
DefaultSigningKey = "default-signing-key"
)

var (
// SigningKey is the key used to sign cookies.
SigningKey = []byte("default-signing-key")
SigningKey = []byte(DefaultSigningKey)
)

var (
Expand Down

0 comments on commit 0275f35

Please sign in to comment.