Skip to main content
Module

x/shed/middleware.ts>cookieSession

All Worker Tools under a single roof
Latest
function cookieSession
import { cookieSession } from "https://deno.land/x/shed@v0.1.0-pre.10/middleware.ts";

Cookie session middleware for worker runtimes.

Requires a cookie store, preferably encrypted or signed.

Important: This will serialize the entire session data and store it in a cookie. It is sent with every request! Only applicable for small session objects. Use storageSession for a traditional, KV store-backed session.

Type Parameters

optional
S extends Rec = Rec

Parameters

optional
options: CookieSessionOptions<S> = [UNSUPPORTED]

Returns

<X extends CookieContext>(ax: Awaitable<X>) => Promise<X & CookieSessionContext<S>>