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

Cannot update session.cookie.maxAge to a value greater than hasLongExpires checks for (4 weeks) #859

Closed
jeremyk opened this issue Aug 5, 2013 · 2 comments
Labels
Milestone

Comments

@jeremyk
Copy link

jeremyk commented Aug 5, 2013

hasLongExpires is currently checking against a hard coded 4 weeks.

I am finding that the check if(!isNew && cookie.hasLongExpires) in session.js fails when trying to update the maxAge to a value greater than 4 weeks as the comparison looks at the new value of maxAge when evaluating hasLongExpires and then skips the cookie update.

I have traced this through the debugger several times and verified that setting req.session.cookie.maxAge of < 4 weeks properly updates the cookie from a session to an expiring cookie but setting it greater than 4 weeks causes no update to the browser cookie.

@shinmei
Copy link

shinmei commented Aug 6, 2013

I confirm, I've seen this behaviour too.

Anoying because my customers come back months after and loose their sessions.

But a session longer than 4 weeks is a security issue. I'm in some way balanced about this question. For the moment I just try to Update the session maxAge often.

But having a hardcoded value is bad, it should be possible to overwrite it via an option.

@asymingt
Copy link

I confirm. I opened up #865 and closed it after subsequently finding this issue.

undoZen added a commit to undoZen/connect that referenced this issue Dec 11, 2013
It's not only not needed, but also cause problems.
senchalabs#859
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants