Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/golangtoolkits/go-secure-cookies
A secure cookie module for golang
https://github.com/golangtoolkits/go-secure-cookies
cookie cookies go golang securecookie
Last synced: about 1 month ago
JSON representation
A secure cookie module for golang
- Host: GitHub
- URL: https://github.com/golangtoolkits/go-secure-cookies
- Owner: GolangToolKits
- License: mit
- Created: 2023-02-13T22:01:03.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-26T01:36:06.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T03:16:21.317Z (6 months ago)
- Topics: cookie, cookies, go, golang, securecookie
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-secure-cookies
A secure cookie module for golang```go
// 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"//write----
w http.ResponseWriter
err := cookies.write(w, ck)var name = "test1"
//read----
r *http.Request
cookieValue, err := cookies.Read(r, name)```