Skip to content

fix: Remove obsolete warning about cookie-size #2012

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 1 commit into from
Apr 1, 2025

Conversation

frederikprijck
Copy link
Member

With the fact that we brought back cookie-chunking, we no longer want to output a warning message when the cookie exceeds the limit in size. Instead, we chunk the cookie in that case.

Additionally, since we added id token back in the session, there is a high chance of users hitting the limit, ending up with chunked cookies, and the fact that they will see an irrelevant warning message.

@frederikprijck frederikprijck requested a review from a team as a code owner March 31, 2025 10:40
@@ -235,9 +235,6 @@ If you'd like to customize the `user` object to include additional custom claims
## Additional changes

- By default, v4 is edge-compatible and as such there is no longer a `@auth0/nextjs-auth0/edge` export.
- Cookie chunking has been removed
- If the cookie size exceeds the browser limit of 4096 bytes, a warning will be logged
- To store large session data, please use a [custom data store](https://github.com/auth0/nextjs-auth0/tree/main?tab=readme-ov-file#database-sessions) with a SessionStore implementation
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also removing this from the migration guide, as this is no longer accurate in the latest version of v4.

@frederikprijck frederikprijck force-pushed the fix/remove-cookie-size-warning branch 2 times, most recently from cb1066e to 989d726 Compare March 31, 2025 10:46
@codecov-commenter
Copy link

codecov-commenter commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.68%. Comparing base (65ece16) to head (baeb49b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2012      +/-   ##
==========================================
- Coverage   74.77%   74.68%   -0.09%     
==========================================
  Files          21       21              
  Lines        1859     1853       -6     
  Branches      287      286       -1     
==========================================
- Hits         1390     1384       -6     
  Misses        462      462              
  Partials        7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

tusharpandey13
tusharpandey13 previously approved these changes Apr 1, 2025
@tusharpandey13 tusharpandey13 merged commit 0d7bfc4 into main Apr 1, 2025
12 checks passed
@tusharpandey13 tusharpandey13 deleted the fix/remove-cookie-size-warning branch April 1, 2025 09:52
@tusharpandey13 tusharpandey13 mentioned this pull request Apr 1, 2025
@MichaelCharles
Copy link

Currently, if you try to google the warning, nothing comes up, so for the sake of google-ability, the warning is,

The cookie size exceeds 4096 bytes, which may cause issues in some browsers. Consider removing any unnecessary custom claims from the access token or the user profile. Alternatively, you can use a stateful session implementation to store the session data in a data store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants