FileSessionStorage
The FileSessionStorage
component persists session data to the file system.
Example code
Anchor link to section titled "Example code"
Prop | Type | Description |
---|---|---|
name | string |
The name of the cookie stored in the browser. |
dir | string |
A directory to store the session files in. Each session is stored in a separate file on the file system. |
cookieOptions | CookieOptions |
An optional object to configure how the cookie is persisted in the browser. |
Component type
Anchor link to section titled "Component type"The FileSessionStorage
component is a server component that renders inside App.server.jsx
. For more information about component types, refer to React Server Components.
Considerations
Anchor link to section titled "Considerations"Because FileSessionStorage
relies on the file system, it shouldn't be used in Edge workers, and instead only in NodeJS deployments.