Documentation
¶
Overview ¶
Package sessions provides session cookie configuration and helpers for Canopy's database-backed opaque sessions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TokenDigest ¶ added in v1.0.0
TokenDigest returns the non-reversible value stores should persist and use for session-token lookup.
Types ¶
type Config ¶
type Config struct {
CookieName string
CookiePath string
CookieDomain string
CookiePrefix string
Secure bool
SameSite http.SameSite
Expiry time.Duration
UpdateAge time.Duration
BrowserSessionMaxAge time.Duration
// AbsoluteMaxAge caps the total lifetime of a session. A session
// cannot live past this age even with regular use.
AbsoluteMaxAge time.Duration
// DisableAbsoluteExpiry turns off the absolute lifetime cap.
DisableAbsoluteExpiry bool
}
func (Config) ClearCookie ¶
func (c Config) ClearCookie(w http.ResponseWriter)
func (Config) SetCookie ¶
func (c Config) SetCookie(w http.ResponseWriter, token string, rememberMe *bool)
func (*Config) SetDefaults ¶
Click to show internal directories.
Click to hide internal directories.