Alumna::Session
Binds a SessionStore to cookie flags. Keep one instance for the rule and for start/stop/rotate so the cookie name and flags stay in sync.
sessions = Alumna::Session.new(Alumna::MemorySessionStore.new(ttl: 24.hours)) app.before sessions.rule sessions.start(ctx, Alumna.hash(user_id: id))
Constants
DEFAULT_COOKIE = "alumna.sid"
DEFAULT_SKIP = ["internal", "local"]
DEFAULT_STORE_KEY = "session"
Constructors
new(store : SessionStore, *, cookie : String = DEFAULT_COOKIE, store_key : String = DEFAULT_STORE_KEY, required : Bool = true, skip_providers : Array(String) = DEFAULT_SKIP, http_only : Bool = true, secure : Bool = false, same_site : Symbol = :lax, path : String = "/", domain : String | Nil = nil)
SourceClass methods
rotate(ctx : RuleContext, store : SessionStore, data : Hash(String, AnyData), ttl : Time::Span | Nil = nil) : String
Sourcestart(ctx : RuleContext, store : SessionStore, data : Hash(String, AnyData), ttl : Time::Span | Nil = nil) : String
Class helpers use the default cookie name and flags. Prefer an instance when you set cookie, secure, or same_site on the rule.
stop(ctx : RuleContext, store : SessionStore) : Nil
SourceInstance methods
cookie
Sourcerule
Sourcestop(ctx : RuleContext) : Nil
Sourcestore
Sourcestore_key
Source