Replies: 1 comment 1 reply
-
The session is not refetched on clientside navigation. it just uses the one that is in the SessionProvider. You can avoid session expiry by polling the session periodically https://next-auth.js.org/getting-started/client#refetch-interval |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Question 💬
I'm experiencing a weird behaviour and I'm not sure if I'm doing something wrong or expecting it wrongly.
I'm using jwt sessions and I've reduced the session
maxAge
to be really small (10 seconds) for testing purposes.Whenever I navigate between next.js pages, everytime the
useSession
hook gets called I receive an expired session.If I do a full browser refresh I now receive an
undefined
session instead of a new fresh session.So my question is:
useSession()
force a session rotation?undefined
session or should I get a fresh rotated session?How to reproduce ☕️
useSession()
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions