Skip to main content

Module session

Module session 

Source
Expand description

Server-side sessions.

Sessions are opt-in. The cookie holds only a random 256-bit identifier; data lives in a SessionStore, so nothing needs to be signed and no data is exposed to the client.

ⓘ
App::new(routes()).middleware(sessions(MemorySessionStore::default()))
// in a page:  pub fn Page(Extension(session): Extension<Session>) -> impl View

Structs§

MemorySessionStore
In-memory store for development and single-instance deployments.
Session
Request-scoped session handle (cheap to clone).

Constants§

SESSION_COOKIE

Traits§

SessionStore
Session storage backend.

Functions§

sessions
Session middleware.
sessions_with_ttl