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.
scs
✓ github.com/alexedwards/scs/v2
Store and retrieve session data in an HTTP handler
package main
import (
"net/http"
"github.com/alexedwards/scs/v2"
)
func main() {
sessionManager := scs.New()
mux := http.NewServeMux()
mux.HandleFunc("/put", func(w http.ResponseWriter, r *http.Request) {
sessionManager.Put(r.Context(), "key", "value")
})
http.ListenAndServe(":4000", sessionManager.LoadAndSave(mux))
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
2.9.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.