Reference
@reckona/mreact-router/internal/session
9 public exports.
Function
FunctioncreateMemorySessionStore
function createMemorySessionStore<TData>(options: MemorySessionStoreOptions): SessionStore<TData>Creates a process-local session store backed by an in-memory LRU-like map. Use it for development, tests, or single-process deployments; production multi-instance deployments should provide a shared `SessionStore`.FunctioncreateSessionfunction createSession<TData>(response: Response, store: SessionStore<TData>, data: TData, options: SessionCookieOptions): Promise<SessionRecord<TData>>Creates a new session record, stores it, and appends the session cookie to the response.FunctiondestroySessionfunction destroySession<TData>(request: Request, response: Response, store: SessionStore<TData>, options: SessionCookieOptions): Promise<void>Deletes the current session record when present and appends an expiring session cookie to the response.FunctiongetSessionfunction getSession<TData>(request: Request, store: SessionStore<TData>, options: SessionCookieOptions): Promise<SessionRecord<TData> | undefined>Reads the current session cookie, loads the matching session record, and deletes expired records.FunctionrotateSessionfunction rotateSession<TData>(request: Request, response: Response, store: SessionStore<TData>, options: SessionCookieOptions): Promise<SessionRecord<TData> | undefined>Replaces the current session id while preserving the stored session data. Use this after authentication or privilege changes to reduce session fixation risk.