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

Session expires only the duration of the user-agent? #190

Open
lautiamkok opened this issue Nov 17, 2019 · 4 comments
Open

Session expires only the duration of the user-agent? #190

lautiamkok opened this issue Nov 17, 2019 · 4 comments

Comments

@lautiamkok
Copy link

How do we enable the cookie to remain for only the duration of the user-agent? That means to make it expired after a browser is closed. Is it possible?

@xulingyuncetcxl
Copy link

a cookie with expire date can not deleted when browser exit.
so, you can add another cookie without expire date.
your app can detect if the new cookie and session are all valid.

@dead-horse
Copy link
Member

set options.maxAge to 'session', it will make browser destroy the cookie when close the browser.

@xulingyuncetcxl
Copy link

the problem is:
you has a cookie with expire time , for example, 20 minutes
now the expire time has not reached yet, for example, only 10 minutes have elapsed
when you close the browser, the cookie not be deleted.
if you open the browser at right, the session is still valid.
so, the only way is has another cookie to check if the browser's closed.

@xreider
Copy link

xreider commented Aug 30, 2020

set options.maxAge to 'session'

How to set options.maxAge to 'session' ????? I extremely need it!
I use exrpess-session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants