Skip to main content

createCookieSessionStorage

还没翻译译自英文(reactrouter.com)本页 14 段都还没译

createCookieSessionStorage

Framework Data

Summary

Reference Documentation ↗

Creates and returns a SessionStorage object that stores all session data directly in the session cookie itself.

This has the advantage that no database or other backend services are needed, and can help to simplify some load-balanced scenarios. However, it also has the limitation that serialized session data may not exceed the browser's maximum cookie size. Trade-offs!

Signature

function createCookieSessionStorage<Data = SessionData, FlashData = Data>({
  cookie: cookieArg,
}: CookieSessionStorageOptions = {}): SessionStorage<Data, FlashData>

Params

options

Options for creating the cookie-backed session storage.

Returns

A SessionStorage object that stores all session data in its cookie.

Traducción © 2026 fanyi.dev · Original © 2026 React Training LLC, Remix Software Inc., Shopify Inc. (MIT)