Registry / web-framework / golangcollege-sessions

golangcollege-sessions

JSON →
library1.2.0gogounverified

Package sessions provides a minimalist and lightweight HTTP session cookie implementation for Go, using nacl/secretbox for encryption and authentication.

go get github.com/golangcollege/sessions
INSTALL
IMPORT
SIG · GOLANGCOLLEGE-SESS
G
golangcollege-sessions
web-frameworkgov1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sessions
github.com/golangcollege/sessions

Initialize a session manager and store a value in a session.

package main import ( "net/http" "github.com/golangcollege/sessions" ) func main() { sessionManager := sessions.New([]byte("secret-key")) http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { sessionManager.Put(r.Context(), "key", "value") }) }
Debug
Known issues
gotchaSession secret key must be 32 bytes long for nacl/secretbox.
fix
Ensure the secret key passed to sessions.New is exactly 32 bytes.
affects: >=1.0.0
Upgrade
Version history
1.2.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
golangcollege-sessions — go get golangcollege-sessions · libregistry