-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
According to the express-session docs, the resave
option should be able to safely be set to false
if a given session store implements the touch
method. This store (connect-mssql-v2) appears to implement touch
, but in my testing, I am not seeing the sessions properly resaved without setting express-session's resave
option to true.
To Reproduce
Steps to reproduce the behavior:
- Implement a web app using
express-session
andconnect-mssql-v2
, settingexpress-session
'scookie.maxAge
setting to something (e.g.,1000 * 60 * 30
for 30 minutes),rolling
totrue
, andresave
tofalse
. - Load a page from the web app, so a new session is established and saved to the MS SQL database.
- View the session in the DB, noting the value of
session.cookie.expires
in the session data. - Reload the page from the web app.
- View the session info again in the DB, noting that the value of
session.cookie.expires
is not updated. - Quit the web app, and change the value of
express-session
'sresave
config option totrue
. - Restart the web app.
- Load a page again.
- Note the session info in the DB, specifically the
session.cookie.expires
value. - Reload the page.
- Finally, note the session info in the DB, specifically that the
session.cookie.expires
value has been updated properly.
Expected behavior
I would expect that the session information would be resaved even without the resave
option set to true
, given what is in the express-session
documentation.
Desktop (please complete the following information):
- Node Version: 22.15.0
- Package Version: express-session 1.18.1, connect-mssql-v2 5.1.0
bradtaniguchi
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working