-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs - createCookieSessionStorage says commitSession not needed #9444
Comments
Yes, the documentation needs to be corrected. For the session API, all session storage providers require you to call I think what the documentation was alluding to was you don't have to return a In cookie session storage, the session data is stored entirely in the cookie, so any changes require you to send an updated cookie via the However, in other storage providers like Cloudflare KV or file-based sessions, the only thing stored in the cookie is the session ID. You would send that id in the |
Might be related with this issue? Its about memory / custom storage, but looks like same sort of problem with the behavior and documentation: |
The docs for
createCookieSessionStorage
state:https://remix.run/docs/en/main/utils/sessions#createcookiesessionstorage
When we moved from
createCookieSessionStorage
to another storage solution (vercel kv), we followed this advice and removed calls tocommitSession
(assuming it was not needed, and thatsession.set
would be all that is required) but it resulted in sessions not being saved.Elsewhere in the docs for
createSessionStorage
:https://remix.run/docs/en/main/utils/sessions#createsessionstorage
Which seems to imply that anything based on
createSessionStorage
will require a call tocommitSession
in order to update the session, and I'm fairly sure explains why we would have bugs when removing calls tocommitSession
.I think the docs for
createCookieSessionStorage
should instead stateI'll raise a PR to the docs for this.
The text was updated successfully, but these errors were encountered: