class

Alumna::MemorySessionStore

Inherits Alumna::SessionStore < Reference < Object

In-process session map. Use one instance per process (single backend). Swap for a Redis SessionStore to share sessions across processes.

Expiry uses Time.instant (monotonic). Cookie Max-Age uses wall clock. No background fiber. Expired rows are dropped on get and by an amortized prune every cleanup_every writes/reads, same as MemoryRateLimitStore.

Constructors

new(ttl : Time::Span = 24.hours, cleanup_every : Int32 = 1024)
Source

Instance methods

delete(id : String) : Nil
Source
get(id : String) : Hash(String, AnyData) | Nil
Source
prune_expired

Spec helper. Not used by the Rule.

Source
set(id : String, data : Hash(String, AnyData), ttl : Time::Span = default_ttl) : Nil
Source
size

Spec helper. Not used by the Rule.

Source

Nested types