Skip to main content

Module session

Module session 

Source
Expand description

Session bag, stores, flash messages, and middleware.

Structs§

AsyncSessionMiddleware
Async AsyncMiddleware variant for serenade_http::AsyncHttpKernel.
CookieSession
Opens and commits sessions using a store plus a session-id cookie.
CookieSessionOptions
Options for the session id cookie written on commit.
FlashBag
One-shot messages keyed by type (success, error, …).
MemorySessionStore
Process-local session store (tests and single-node dev).
Session
Mutable key/value session attributes for one request lifecycle.
SessionMiddleware
Loads a session before the handler and commits it afterward (sync kernel).

Enums§

SameSite
SameSite attribute for the session cookie.
SessionError
Failure while reading or writing session state.

Constants§

DEFAULT_SESSION_COOKIE
Default session cookie name.
FLASH_SESSION_KEY
Session attribute key for serialized flash messages.
SESSION_ATTRIBUTE
Request attribute key where the session middleware stores the Session.

Traits§

SessionStore
Loads and saves session attribute maps by id.

Functions§

generate_session_id
Generates a new opaque session id (32 random bytes, hex-encoded).
parse_cookie_value
Reads name from a raw Cookie header (a=1; b=2).
request_session
Returns the session from request attributes when present.
request_session_mut
Returns a mutable session from request attributes when present.