Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End Session on Browser Close #974

Closed
jacklimwenjie opened this issue Dec 21, 2020 · 5 comments
Closed

End Session on Browser Close #974

jacklimwenjie opened this issue Dec 21, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request stale Did not receive any activity for 60 days

Comments

@jacklimwenjie
Copy link

Summary of proposed feature
Expose an option to not persist a session, which the session will be terminated on browser close.

Purpose of proposed feature
Some system has a "remember me" or "keep me logged in" option to specify if a session should be persisted to avoid a scenario such as forgot to log out from a public computer.

Detail about proposed feature
Make the session options to support maxAge:0 to set the cookie to expire on 'Session'. Currently, setting maxAge to value 0 will cause an error.

Alternatively, expose the cookie as an API from the module so that developer can use it to modify the cookie as needed, such as setting the expiry to 'Session'.

@jacklimwenjie jacklimwenjie added the enhancement New feature or request label Dec 21, 2020
@balazsorban44 balazsorban44 self-assigned this Jan 1, 2021
@stale stale bot added the stale Did not receive any activity for 60 days label Mar 2, 2021
@nextauthjs nextauthjs deleted a comment from stale bot Mar 2, 2021
@stale stale bot removed the stale Did not receive any activity for 60 days label Mar 2, 2021
@balazsorban44
Copy link
Member

balazsorban44 commented Mar 2, 2021

Although it would be possible to expire the cookie when closing the browser but without federated logout (#836), the user will still potentially be logged in on the computer. You could set a short lifetime to your access_token. That would at least make it harder for someone to misuse the forgotten account that is logged in.

@stale
Copy link

stale bot commented May 2, 2021

Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep it open. (Read more at #912) Thanks!

@stale stale bot added the stale Did not receive any activity for 60 days label May 2, 2021
@stale
Copy link

stale bot commented May 9, 2021

Hi there! It looks like this issue hasn't had any activity for a while. To keep things tidy, I am going to close this issue for now. If you think your issue is still relevant, just leave a comment and I will reopen it. (Read more at #912) Thanks!

@ricardasjak
Copy link

Same issue for me, I would like to set expire time to browser session.

@narutodev123
Copy link

Want user to get logged out if user close the browser. Please guide us on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale Did not receive any activity for 60 days
Projects
None yet
Development

No branches or pull requests

4 participants