Abstract base session store.
Instance methods
Returns the value associated with the passed key or raises a KeyError exception if not found.
SourceAllows to set a new session value for a specific key.
SourceReturns the value associated with the passed key or returns nil if not found.
Sourceaccessed?
Returns true if the session store was accessed at least once.
Sourcecreate
Creates a new session store.
This method should create a new (empty) session store with an associated key and persist it.
Sourcecycle_key
Regenerates the session key while keeping all the existing data.
SourceAllows to delete a session value for a specific key.
Sourceeach(*args, **options, &)
Sourceempty?
Returns true if the session store is empty.
Sourceexpires_at
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.
Sourceexpires_at=(value :
Time)
Allows to set the date time when the session will expire.
Sourceexpires_at_browser_close=(value :
Bool)
Allows to set whether the session should expire when the browser is closed.
Sourceexpires_at_browser_close?
Sourceexpires_in
Returns the session expiration time.
Unless explicitly set, the default value returned is the one defined by the sessions.cookie_max_age
setting.
SourceAllows to set the session expiration time.
Sourceexpires_in=(value :
Int64)
Allows to set the session expiration time in seconds.
SourceReturns the value associated with the passed key, or the passed default if the key is not found.
SourceReturns the value associated with the passed key, or calls a block with the key when not found.
Sourceflush
Flushes the session store data.
SourceReturns true if the provided key exists.
Sourceload
Loads the session store data and returns the corresponding hash.
Sourcemodified?
Returns true if the session store was modified.
Sourcesave
Saves the session store data.
Sourcesize(*args, **options)
Returns the number of keys in the session hash.
Sourcesize(*args, **options, &)
Returns the number of keys in the session hash.
Source