JWT callback returns large token → split into .0, .1, .2 cookies #13185
Unanswered
sanjayrajeev
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m using next-auth with the jwt session strategy and running into a problem with cookie size when storing multiple API tokens.
Here’s my jwt callback:
In my case, manageTokens merges three different API tokens (Cognito + other APIs) into the JWT payload. but in
__Secure-next-auth.session-token
cookie becomes too large and NextAuth splits it into multiple cookies (.0, .1, .2).Why this is a problem
Questions
Any guidance or best practices would be appreciated 🙏

Beta Was this translation helpful? Give feedback.
All reactions