method ISessionService.from
ISessionService.from(ctx: IRequestContext): ISession

Returns the session the middleware loaded for this request.

This is the single entry point: the middleware, route handlers, the CSRF middleware, and framework bridges all read the same instance, so no caller can observe a differently-configured session.

Parameters

The request context

Return Type

The session for this request

Throws

Error

If the session middleware did not run for this request

Usage

import { type ISessionService } from "common/src/index.ts";