SessionIdStorageStrategy
react-router

SessionIdStorageStrategy interface

SessionIdStorageStrategy is designed to allow anyone to easily build their own SessionStorage using createSessionStorage(strategy).

This strategy describes a common scenario where the session id is stored in a cookie but the actual session data is stored elsewhere, usually in a database or on disk. A set of create, read, update, and delete operations are provided for managing the session data.

Properties

Type: Cookie | CookieParseOptions & CookieSerializeOptions & CookieSignatureOptions & { name: string, }

The Cookie used to store the session id, or options used to automatically create one.

createData

Type: { }

Creates a new record with the given data and returns the session id.

deleteData

Type: { }

Deletes data for a given session id from the data store.

readData

Type: { }

Returns data for a given session id, or null if there isn't any.

updateData

Type: { }

Updates data for the given session id.

Docs and examples CC 4.0