Documentation
¶
Overview ¶
Package session implements the panel's HMAC-signed cookie.
Cookie value is base64(json(payload)) + "." + base64(hmac-sha256). We sign payload bytes (not the encoded form) so encoding tweaks don't void existing cookies.
Index ¶
Constants ¶
View Source
const ( CookieName = "prosa_panel" // DefaultTTL mirrors INTENT §6: 30 days. DefaultTTL = 30 * 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager produces and validates cookies. Construct once with the HMAC key + secure flag and reuse across handlers.
func NewManager ¶
NewManager builds a Manager. hexKey is the hex-encoded HMAC secret; fall back to using its raw bytes if it isn't actually hex.
func (*Manager) Clear ¶
func (m *Manager) Clear(w http.ResponseWriter)
func (*Manager) FromRequest ¶
FromRequest returns the verified Session attached to r, or false when the cookie is missing / tampered / expired.
Click to show internal directories.
Click to hide internal directories.