module Athena::HTTP::Session::Storage::Interface
#
Manages the lifecycle of an AHTTP::Session: loading and persisting its data and bags, as well as its ID.
Direct including types
Athena::HTTP::Session::Storage
Methods#
abstract #bag(name : String) : AHTTP::Session::BagInterface#
Returns the bag registered with the provided name, starting the session if needed.
abstract #id : String#
Returns the ID of the session, or an empty string if it does not have one yet.
abstract #metadata_bag : AHTTP::Session::Storage::MetadataBag#
Returns the bag storing the session's metadata.
abstract #regenerate(destroy : Bool = false, lifetime : Int32 | Nil = nil) : Bool#
Gives the session a new ID while keeping its data, optionally removing the persisted data of the current ID if destroy is true.
Optionally sets the lifetime of its cookie in seconds, 0 meaning until the browser is closed.
Returns true if the session was given a new ID, otherwise false.
abstract #register_bag(bag : AHTTP::Session::BagInterface) : Nil#
Registers the provided bag, whose data is loaded and persisted along with the session.
abstract #start : Bool#
Starts the session, loading its data.
Returns true once the session is started.