Skip to main content

createMemorySessionStorage

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

createMemorySessionStorage

Framework Data

Summary

Reference Documentation ↗

Creates and returns a simple in-memory SessionStorage object.

Intended for local development and testing. It does not scale beyond a single process, and all session data is lost when the server process stops/restarts.

Signature

function createMemorySessionStorage<Data = SessionData, FlashData = Data>({
  cookie,
}: MemorySessionStorageOptions = {}): SessionStorage<Data, FlashData>

Params

options

Options for creating the in-memory session storage.

Returns

A SessionStorage object that stores session data in memory.