Skip to content

docs(utils/sessions): improve docs #7247

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

Merged
merged 5 commits into from
May 8, 2025

Conversation

aaronadamsCA
Copy link
Contributor

See #7225 (comment) for details. In the absence of a larger rewrite I think this should substantially improve clarity and reduce confusion.

Key bits include:

  • Clarifying that regardless of your session storage strategy, if you don't commitSession(), you're losing your changes.
  • Further clarifying that if you are using cookie session storage and you don't Set-Cookie, you're still losing your changes.
  • Correcting the cookie size limit. It's actually 1024 bytes for a single cookie value in Chromium and Firefox (sources: RFC 6265, Chrome Platform Status). 4 KB is the limit for all cookie names + values combined.
  • Consistently recommending app/session.server.ts over app/session.ts.

The one more opinionated thing I did as well was to remove the lengthy example under session.flash(), because there is already an example of the same thing earlier in the doc.

Please let me know if there's anything else I can do to help ship this, so that I can stop making the same mistakes over and over every time I read this doc page. Thanks!

@brophdawg11

@changeset-bot
Copy link

changeset-bot bot commented Aug 24, 2023

⚠️ No Changeset found

Latest commit: 033a695

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@MichaelDeBoey MichaelDeBoey changed the title docs: Correct and improve Sessions docs docs(utils/sessions): improve docs Aug 25, 2023
@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Aug 25, 2023

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@brophdawg11 brophdawg11 added the feat:sessions Sessions related issues label Aug 25, 2023
@MichaelDeBoey MichaelDeBoey added needs-response We need a response from the original author about this issue/PR and removed needs-response We need a response from the original author about this issue/PR labels Oct 31, 2023
@MichaelDeBoey
Copy link
Member

@aaronadamsCA Are you still interested in getting this PR merged?
If so, could you please rebase onto latest main & resolve conflicts?

@MichaelDeBoey MichaelDeBoey added the needs-response We need a response from the original author about this issue/PR label Oct 31, 2023
@aaronadamsCA
Copy link
Contributor Author

Whoops, thanks for the bump, @MichaelDeBoey! I completely forgot about this.

I've updated the branch and made @brophdawg11's requested changes. The only thing that needs checking is the line numbers in the code block, I'm not sure how to preview those to ensure the correct lines are being highlighted.

@github-actions github-actions bot removed the needs-response We need a response from the original author about this issue/PR label Nov 2, 2023
@brophdawg11 brophdawg11 merged commit 2f26deb into remix-run:main May 8, 2025
2 checks passed
@aaronadamsCA
Copy link
Contributor Author

Thanks for the merge @brophdawg11, though as I read these changes back a year and a half later, I desperately hope React Router middleware can at last solve all these race-condition pains. 😅

@aaronadamsCA aaronadamsCA deleted the update-sessions-docs branch May 9, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed docs feat:sessions Sessions related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants