Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
session: add long expires check and prevent set-cookie
- Loading branch information
Showing
3 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86c72bd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check for hasLongExpires (4 weeks) seems buggy. It stops us from being able to implement a "rollng session" with maxAge of more than 4 weeks.
Say we want to implement a "rolling session" with maxAge of 3 months. We hack the "rolling session" by updating the session object. But still the cookie is never updated in the browser. Not until there's 4 weeks left. So if the user is active for two months and the stops, his session will be good for only another 4 weeks, instead of 3 months as one would expect.