Returns a value from the session data table.
@eryx/http/ServerSession Module
JSON
Summary
Classes
Functions
API Reference
Classes
SessionStore
Properties
SessionStore:get
SessionStore:set
SessionStore:delete
Session
Properties
Session:get
Session:set
Sets a value and marks the session dirty for persistence.
Session:delete
Removes a value and marks the session dirty.
Session:clear
Clears all session data.
Session:regenerate
Assigns a fresh session id and preserves the current data.
Session:destroy
Deletes the session from the backing store and clears the cookie.
Functions
SessionMethods:get
SessionMethods:set
SessionMethods:delete
SessionMethods:clear
SessionMethods:regenerate
SessionMethods:destroy
MemoryStoreMethods:get
MemoryStoreMethods:set
MemoryStoreMethods:delete
MemoryStoreMethods:touch
FileStoreMethods:_pathFor
FileStoreMethods:get
FileStoreMethods:set
FileStoreMethods:delete
FileStoreMethods:touch
SqliteStoreMethods:get
SqliteStoreMethods:set
SqliteStoreMethods:delete
SqliteStoreMethods:touch
ServerSession.memoryStore
Creates an in-memory session store.
Returns
SessionStore
ServerSession.fileStore
Creates a filesystem-backed session store where each session is stored as JSON.
Parameters
Directory used for session files.
Returns
SessionStore
ServerSession.sqliteStore
Creates an SQLite-backed session store.
Parameters
Either a path string or an open @eryx/sqlite3 database.
Optional table name. Defaults to "http_sessions".
Returns
SessionStore
ServerSession.middleware
Creates app middleware that attaches a server-side session to ctx.session.
The middleware loads the session from a cookie before the handler runs and persists it back to the configured store after the handler completes.
Parameters
Session configuration and backing store.
Returns
(ctx: any, next: () -> any) -> any