data Bezel::Session

The session's values, which Plug::Session loads from its store (Session::Store) and writes back when they changed; empty, and not loaded, without that plug. Values are strings (an application stores ids, not objects).

src/conn.qz:20

Classes and modules

Methods

def values -> Hash[String, String]

src/conn.qz:20

def changed -> Bool

src/conn.qz:20

def dropped -> Bool

src/conn.qz:20

def loaded -> Bool

src/conn.qz:20

def with(*, values: Hash[String, String] = …, changed: Bool = …, dropped: Bool = …, loaded: Bool = …) -> Bezel::Session

A copy with the fields given replaced.

src/conn.qz:22

def to_h -> Hash[Symbol, Object]

The fields as a Hash, by name.

src/conn.qz:22

def [](key: String) -> String?

The value of key, or nil.

src/conn.qz:22

def put(key: String, value: String) -> Bezel::Session

The session with key set to value. (After drop, a value put starts a new session: logging in after dropping the old one.)

src/conn.qz:27

def delete(key: String) -> Bezel::Session

The session without key.

src/conn.qz:30

def drop -> Bezel::Session

The session dropped (logging out): none of its values kept, but a fresh CSRF secret when it had one; a store deletes its cookie when nothing is left, else writes the new one. The CSRF secret goes too, replaced by a fresh one when the session had one, so that a page rendered after drop has a token that holds.

src/conn.qz:37

def renew -> Bezel::Session

The session with a new CSRF secret (when it had one): the values stay, so that a page rendered after it carries a token of the new secret. Against a session planted before a login, drop then put the user's id: renew keeps whatever else the planted cookie held. (A server-side store would change its id here too.)

src/conn.qz:47