class

Alumna::SessionStore

Inherits Reference < Object

Persistence for session records. MemorySessionStore is the in-process adapter. A Redis adapter can implement the same three methods and drop in.

get/set copy the data hash (shallow). In-place mutation of a returned hash does not change the store. Call set to persist. This matches a remote store.

TTL is absolute from the last set. The store does not slide the deadline on get. Pass a different ttl to set or Session.start when needed.

Constructors

new(default_ttl : Time::Span)
Source

Instance methods

default_ttl
Source
delete(id : String) : Nil
Source
get(id : String) : Hash(String, AnyData) | Nil
Source
new_id
Source
set(id : String, data : Hash(String, AnyData), ttl : Time::Span) : Nil
Source