CookieSessionStorage
The CookieSessionStorage
component is the default session storage mechanism for Hydrogen.
Example code
Anchor link to section titled "Example code"
Prop | Type | Description |
---|---|---|
cookieName | string |
The name of the cookie stored in the browser. |
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 CookieSessionStorage
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"Don't use CookieSessionStorage
if you expect to have more than 4kb of data within sessions.