Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidName ¶
IsValidName returns true if the session name contains only alphanumeric characters, hyphens, and underscores.
Types ¶
type Session ¶
type Session struct {
Name string
Cookies []SessionCookie
// contains filtered or unexported fields
}
Session represents a named cookie session.
func Load ¶
Load loads a session from disk or creates a new empty session. Expired cookies are filtered out on load.
type SessionCookie ¶
type SessionCookie struct {
Name string `json:"name"`
Value string `json:"value"`
Domain string `json:"domain"`
Path string `json:"path,omitzero"`
Expires time.Time `json:"expires,omitzero"`
Secure bool `json:"secure,omitzero"`
HttpOnly bool `json:"http_only,omitzero"`
SameSite string `json:"same_site,omitzero"`
}
SessionCookie represents a JSON-serializable cookie.
Click to show internal directories.
Click to hide internal directories.