Setting session-token cookie to expire with browser session #10277
Unanswered
saurabhg138
asked this question in
Help
Replies: 1 comment
-
I have the same need. Have you solved it somehow? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using next-auth 4.24.5 version
In my application I want to expire the session when user close out of browser. can this be achieved by next auth.
For now cookie maxAge is not provided by me so it uses default of 30 days. I tried setting it to undefined so as to make it session cookie
session: {
strategy: 'jwt',
maxAge: undefined,
},
but this gives 500 internal server error for http://localhost:3000/api/auth/callback/credentials
TypeError: option expires is invalid
I tried setting maxAge as undefined due to normal javascript if we dont give cookie lifespan it will expire with session
Beta Was this translation helpful? Give feedback.
All reactions