Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KenWilliamson committed Feb 22, 2023
1 parent 2a53370 commit 68894f1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@
A secure cookie module for golang

```go
//write----

// securekey must be at least 16 char long
// The key argument should be the AES key,
// either 16, 24, or 32 bytes to select
// AES-128, AES-192, or AES-256.
var key = "dsdfs6dfs61dssdfsdfdsdsfsdsdllsd"
cookies, err := NewCookies(key)

var ck http.Cookie
ck.Name = "test1"
ck.Value = "this-is-a-test-and-more"

w http.ResponseWriter
err := cookies.write(w, ck)
//write----
w http.ResponseWriter
err := cookies.write(w, ck)


var name = "test1"
var name = "test1"

r *http.Request
cookieValue, err := cookies.Read(r, name)
//read----
r *http.Request
cookieValue, err := cookies.Read(r, name)


```

0 comments on commit 68894f1

Please sign in to comment.