Skip to content

Custom session expire date #2790

Answered by balazsorban44
aboveyunhai asked this question in Help
Discussion options

You must be logged in to vote

The session expiry is not the same as a third party access token. next-auth rotates the session expiry, meaning whenever the client contacts the backend, it will update the session expiry date. (which is basically the cookie lifetime)

with other words, the session doesn't have a fixed/absolute expiry time as usually access tokens have.

If the user doesn't open the page for a while, the cookie will expire and will be removed automatically. so make sure the session expiry is always lower than your access token expiry date, if you cannot refresh the access token.

hope that makes sense!

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
3 replies
@aboveyunhai
Comment options

@balazsorban44
Comment options

@aboveyunhai
Comment options

Answer selected by aboveyunhai
Comment options

You must be logged in to vote
2 replies
@aboveyunhai
Comment options

@aman-godara
Comment options

Comment options

You must be logged in to vote
3 replies
@aman-godara
Comment options

@aboveyunhai
Comment options

@saurabhg138
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Ask how to do something or how something works
5 participants
Converted from issue

This discussion was converted from issue #2789 on September 18, 2021 23:42.