How can I set the "authjs.session-token" cookie to expire as "Session"?
Unanswered
Round sardinella posted this in #help-forum
Round sardinellaOP
I would like to implement a feature where every time the user closes the browser, the user is logged out, I am using nexthAuth with next 14
1 Reply
Willow shoot sawfly
I don't think it's really possible. There's a window event called
You could also check the document.visibilityState but it doesn't ensure that the user closed the tab/window/browser.
Another technique could be using a periodic "heartbeat", when the server detects that client is inactive, you could clear the session.
beforeunload but it fires for a variety of user actions.You could also check the document.visibilityState but it doesn't ensure that the user closed the tab/window/browser.
Another technique could be using a periodic "heartbeat", when the server detects that client is inactive, you could clear the session.