Versions in this module Expand all Collapse all v0 v0.1.0 Jan 17, 2026 Changes in this version + const DefaultPostgresTable + var ErrInvalidCookie = errors.New("invalid session cookie") + type CookieStore struct + HTTPOnly bool + Keys [][]byte + MaxAge time.Duration + Name string + Path string + SameSite http.SameSite + Secure bool + func NewCookieStore(name string, key []byte, oldKeys ...[]byte) *CookieStore + func (s *CookieStore) Clear(w http.ResponseWriter, session *Session) + func (s *CookieStore) Get(r *http.Request) (*Session, error) + func (s *CookieStore) Save(w http.ResponseWriter, session *Session) error + type MemoryOption func(*MemoryStore) + func WithSessionHTTPOnly(enabled bool) MemoryOption + func WithSessionPath(path string) MemoryOption + func WithSessionSameSite(mode http.SameSite) MemoryOption + func WithSessionSecure(enabled bool) MemoryOption + type MemoryStore struct + HTTPOnly bool + Name string + Path string + SameSite http.SameSite + Secure bool + TTL time.Duration + func NewMemoryStore(name string, ttl time.Duration, options ...MemoryOption) *MemoryStore + func (s *MemoryStore) Clear(w http.ResponseWriter, session *Session) + func (s *MemoryStore) Get(r *http.Request) (*Session, error) + func (s *MemoryStore) Save(w http.ResponseWriter, session *Session) error + type PostgresOptions struct + DB *sql.DB + DisableDefaults bool + HTTPOnly bool + Name string + Path string + SameSite http.SameSite + Secure bool + TTL time.Duration + Table string + Timeout time.Duration + type PostgresStore struct + DB *sql.DB + HTTPOnly bool + Name string + Path string + SameSite http.SameSite + Secure bool + TTL time.Duration + Table string + Timeout time.Duration + func NewPostgresStore(options PostgresOptions) (*PostgresStore, error) + func (s *PostgresStore) Cleanup(ctx context.Context) error + func (s *PostgresStore) Clear(w http.ResponseWriter, session *Session) + func (s *PostgresStore) EnsureTable(ctx context.Context) error + func (s *PostgresStore) Get(r *http.Request) (*Session, error) + func (s *PostgresStore) Save(w http.ResponseWriter, session *Session) error + type RedisOptions struct + Address string + DB int + DialTimeout time.Duration + DisableDefaults bool + HTTPOnly bool + Name string + Network string + Password string + Path string + Prefix string + ReadTimeout time.Duration + SameSite http.SameSite + Secure bool + TTL time.Duration + Username string + WriteTimeout time.Duration + type RedisStore struct + func NewRedisStore(options RedisOptions) *RedisStore + func (s *RedisStore) Clear(w http.ResponseWriter, session *Session) + func (s *RedisStore) Get(r *http.Request) (*Session, error) + func (s *RedisStore) Save(w http.ResponseWriter, session *Session) error + type Session struct + ID string + Values map[string]string + func (s *Session) Clear(w http.ResponseWriter) + func (s *Session) Delete(key string) + func (s *Session) Get(key string) string + func (s *Session) IsNew() bool + func (s *Session) Save(w http.ResponseWriter) error + func (s *Session) Set(key, value string) + type Store interface + Clear func(http.ResponseWriter, *Session) + Get func(*http.Request) (*Session, error) + Save func(http.ResponseWriter, *Session) error