Skip to content

Commit

Permalink
further wording fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
syntaqx committed Jul 1, 2024
1 parent 06faf43 commit 6c3e915
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ cookie.Set(w, "debug", "true", &cookie.Options{
})
```

But will need to explicitly `GetSigned` when retrieving the value.

When defaulting to signed cookies, you can still use the `unsigned` tag in the
struct field to populate unsigned cookies:

Expand All @@ -172,3 +170,13 @@ type MyCookies struct {
Debug bool `cookie:"debug,unsigned"`
}
```

Unsigned values can still be retrieved using the `Get` method as normal:

```go
debug, err := cookie.Get(r, "debug")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
```

0 comments on commit 6c3e915

Please sign in to comment.