UNPKG

1.21 kBTypeScriptView Raw
1
2import { SessionData, SessionIdStorageStrategy, SessionStorage } from "../sessions.js";
3
4//#region lib/server-runtime/sessions/cookieStorage.d.ts
5interface CookieSessionStorageOptions {
6 /**
7 * The Cookie used to store the session data on the client, or options used
8 * to automatically create one.
9 */
10 cookie?: SessionIdStorageStrategy["cookie"];
11}
12/**
13 * Creates and returns a SessionStorage object that stores all session data
14 * directly in the session cookie itself.
15 *
16 * This has the advantage that no database or other backend services are
17 * needed, and can help to simplify some load-balanced scenarios. However, it
18 * also has the limitation that serialized session data may not exceed the
19 * browser's maximum cookie size. Trade-offs!
20 *
21 * @public
22 * @category Utils
23 * @mode framework
24 * @mode data
25 * @param options Options for creating the cookie-backed session storage.
26 * @returns A {@link SessionStorage} object that stores all session data in its
27 * cookie.
28 */
29declare function createCookieSessionStorage<Data = SessionData, FlashData = Data>({
30 cookie: cookieArg
31}?: CookieSessionStorageOptions): SessionStorage<Data, FlashData>;
32//#endregion
33export { createCookieSessionStorage };
\No newline at end of file