Skip to main content

Module session

Module session 

Source
Expand description

Stateless dashboard session cookies (#2).

prospero_session=v1.<name>.<expires>.<mac>; the MAC binds the token name, expiry and the first 16 bytes of the token’s current hash, so removing or rotating a token invalidates its sessions on every replica with no store.

Constants§

COOKIE_NAME
Cookie name.
SESSION_TTL_SECS
Fixed session lifetime (12 h).

Functions§

clear_cookie
A Set-Cookie value that deletes the session.
cookie_value
The prospero_session value from the request’s Cookie headers.
is_https
Whether a TLS-terminating proxy reported HTTPS.
same_origin
Same-origin test for cookie-authenticated mutations.
set_cookie
A Set-Cookie value.
sign
The cookie value for entry, valid until expires_unix.
verify
Verify a cookie value against the current tokens. Token names cannot contain . and base64url has no ., so the value splits unambiguously.