module Session::Web

Defined in:

azu.cr

Macro Summary

Macro Detail

macro accessors(session_type) #

Adds HTTP::Server::Context#session (typed as session_type) and #flash. They read the current request's session, so they are only meaningful behind a Session::SessionHandler. Call it after Session.use_store, and once: calling it again redefines the accessors and their types for the whole program.

They are valid inside the request's fiber only (a spawned fiber, or a WebSocket channel after the handler returned, has no session) and raise MissingSession anywhere else.


[View source]
macro use_store(store_type) #

Declares the session type and its store (Session.use_store) and adds the typed HTTP::Server::Context#session and HTTP::Server::Context#flash accessors.


[View source]