class CacheSessionStore
implements ISessionStore
Since 0.2.0

ISessionStore over any ICacheStore.

Examples

Example 1

// Registered for you by the plugin:
SessionPlugin({ secret, store: 'cache' });

Constructors

CacheSessionStore(
cache: ICacheStore,
)
Parameters
cache: ICacheStore

The cache resolved from CAPABILITIES.CACHE

optional
options: CacheSessionStoreOptions

Namespacing options

Methods

destroy(id: string): Promise<boolean>

Removes a stored session.

isHealthy(): Promise<boolean>

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.

read(id: string): Promise<SessionData | null>

Reads a stored session payload.

write(
id: string,
data: SessionData,
ttlMs: number
): Promise<void>

Writes a session payload, replacing any existing one.

Usage

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