Setu-TS
    Preparing search index...

    Interface ISessionStore

    Server-side session storage port.

    Implemented by the plugin's MemorySessionStore and CacheSessionStore, and by any application-supplied backend. Only the store strategy uses it; the default cookie strategy keeps the payload in the cookie and needs no store.

    Every method is async so a network-backed store fits without change.

    0.2.0

    interface ISessionStore {
        close?(): Promise<void>;
        destroy(id: string): Promise<boolean>;
        isHealthy?(): Promise<boolean>;
        read(id: string): Promise<SessionData | null>;
        write(id: string, data: SessionData, ttlMs: number): Promise<void>;
    }

    Implemented by

    Index
    • Releases resources held by the store (timers, connections).

      Optional: called from the plugin's onClose. A store holding nothing omits it.

      Returns Promise<void>

    • Removes a stored session.

      Parameters

      • id: string

        Session identifier

      Returns Promise<boolean>

      true when an entry was removed

    • Reports the store's reachability, for the plugin's health indicator.

      Optional: a store with no meaningful liveness check omits it, and the indicator then reports only that a store is configured.

      Returns Promise<boolean>

      true when the store is reachable

    • Writes a session payload, replacing any existing one.

      Parameters

      • id: string

        Session identifier

      • data: SessionData

        The payload to persist

      • ttlMs: number

        Time-to-live in milliseconds from now

      Returns Promise<void>