Versions in this module Expand all Collapse all v1 v1.0.0 Jul 3, 2026 Changes in this version + var ErrNotFound = errors.New("session: not found") + type Config struct + CookieName string + Domain string + HTTPOnly bool + Path string + SameSite http.SameSite + Secure bool + TTL time.Duration + func DefaultConfig() Config + type Manager struct + func NewManager(store Store, cfg ...Config) *Manager + func (m *Manager) Destroy(ctx context.Context, w http.ResponseWriter, sess *Session) error + func (m *Manager) Save(ctx context.Context, w http.ResponseWriter, sess *Session) error + func (m *Manager) Start(ctx context.Context, r *http.Request, w http.ResponseWriter) (*Session, error) + type Session struct + ID string + func (s *Session) Delete(key string) + func (s *Session) Flash(key string, value any) + func (s *Session) Get(key string) (any, bool) + func (s *Session) GetFlash(key string) (any, bool) + func (s *Session) Has(key string) bool + func (s *Session) IsNew() bool + func (s *Session) Regenerate(ctx context.Context) error + func (s *Session) Set(key string, value any) + type Store interface + Delete func(ctx context.Context, id string) error + Get func(ctx context.Context, id string) (map[string]any, error) + Regenerate func(ctx context.Context, oldID string) (string, error) + Set func(ctx context.Context, id string, data map[string]any, ttl time.Duration) error