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.

get is Hash (session), nil (no session), or StoreError (store down). Nil is never a failure. MemorySessionStore never returns StoreError.

Constructors

new(default_ttl : Time::Span)
Source

Instance methods

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