Setu-TS
    Preparing search index...

    A session store backed by Workers KV.

    Constructed by the application and handed to SessionPlugin, not registered by CloudflarePlugin: SessionPluginOptions.store is read when the plugin is constructed, which is before any application exists, so a store published in the service registry could never reach it.

    KV's eventual consistency applies. A destroy() propagates within seconds rather than instantly, which is still strictly better than the cookie strategy, where a stolen cookie stays valid until maxAge.

    import { env } from 'cloudflare:workers';
    import { createRuntimeServices } from '@setu-ts/runtime';
    import { KvSessionStore } from '@setu-ts/cloudflare-plugin';

    const runtime = createRuntimeServices({ env });

    app.register(SessionPlugin({
    secret: String(env.SESSION_SECRET),
    mode: 'sign',
    store: new KvSessionStore(env.SESSIONS as IKvNamespace, runtime),
    }));

    0.2.0

    Implements

    Index