abstract class Marten::HTTP::Session::Store::Base
- Marten::HTTP::Session::Store::Base
- Reference
- Object
Overview
Abstract base session store.
Direct Known Subclasses
Defined in:
marten/http/session/store/base.crConstructors
Instance Method Summary
-
#[](key : String | Symbol)
Returns the value associated with the passed key or raises a
KeyError
exception if not found. -
#[]=(key : String | Symbol, value : String)
Allows to set a new session value for a specific
key
. -
#[]?(key : String | Symbol)
Returns the value associated with the passed key or returns
nil
if not found. -
#accessed? : Bool
Returns
true
if the session store was accessed at least once. - #clear_expired_entries : Nil
-
#create : Nil
Creates a new session store.
-
#cycle_key : Nil
Regenerates the session key while keeping all the existing data.
-
#delete(key : String | Symbol)
Allows to delete a session value for a specific
key
. - #each(*args, **options)
- #each(*args, **options, &)
-
#empty? : Bool
Returns
true
if the session store is empty. -
#expires_at
Returns the time when the session will expire.
-
#expires_at=(value : Time)
Allows to set the date time when the session will expire.
-
#expires_at_browser_close=(value : Bool)
Allows to set whether the session should expire when the browser is closed.
- #expires_at_browser_close? : Bool
-
#expires_in
Returns the session expiration time.
-
#expires_in=(value : Time::Span)
Allows to set the session expiration time.
-
#expires_in=(value : Int64)
Allows to set the session expiration time in seconds.
-
#fetch(key : String | Symbol, default = nil)
Returns the value associated with the passed
key
, or the passeddefault
if the key is not found. -
#fetch(key : String | Symbol, &)
Returns the value associated with the passed
key
, or calls a block with the key when not found. -
#flush : Nil
Flushes the session store data.
-
#has_key?(key : String | Symbol)
Returns
true
if the providedkey
exists. -
#load : SessionHash
Loads the session store data and returns the corresponding hash.
-
#modified? : Bool
Returns
true
if the session store was modified. -
#save : Nil
Saves the session store data.
- #session_key : String?
-
#size(*args, **options)
Returns the number of keys in the session hash.
-
#size(*args, **options, &)
Returns the number of keys in the session hash.
Constructor Detail
Instance Method Detail
Returns the value associated with the passed key or raises a KeyError
exception if not found.
Allows to set a new session value for a specific key
.
Returns the value associated with the passed key or returns nil
if not found.
Creates a new session store.
This method should create a new (empty) session store with an associated key and persist it.
Returns the time when the session will expire.
This method will return nil
if the session is set to expire when the browser is closed.
Allows to set whether the session should expire when the browser is closed.
Returns the session expiration time.
Unless explicitly set, the default value returned is the one defined by the sessions.cookie_max_age
setting.
Returns the value associated with the passed key
, or the passed default
if the key is not found.
Returns the value associated with the passed key
, or calls a block with the key when not found.