class SessionTooLargeError
extends Error
Since 0.2.0

Thrown when a committed session cookie would exceed the configured byte budget, which browsers enforce at roughly 4 KB per cookie.

Without this, an oversized cookie is silently dropped by the client and the user appears to be logged out at random — a failure that is very hard to diagnose. Move large payloads to the store strategy instead.

Constructors

SessionTooLargeError(
actual: number,
limit: number
)
Parameters
actual: number

The serialized cookie size in bytes

limit: number

The configured maximum

Properties

readonly
name: string

Discriminant for consumers that cannot use instanceof across realms.

Usage

import { SessionTooLargeError } from "session-plugin/src/index.ts";