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.
session
✓ github.com/fasthttp/session/v2
Create a session store and use it in a fasthttp handler
package main
import (
"github.com/fasthttp/session/v2"
"github.com/valyala/fasthttp"
)
func main() {
store := session.NewCookieStore([]byte("secret"))
sess := session.New(session.Config{
Store: store,
})
h := func(ctx *fasthttp.RequestCtx) {
s, _ := sess.Get(ctx)
s.Set("key", "value")
s.Save(ctx)
}
fasthttp.ListenAndServe(":8080", h)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
2.5.9latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.