-
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-sessionandconnect-mssql-v2, settingexpress-session'scookie.maxAgesetting to something (e.g.,1000 * 60 * 30for 30 minutes),rollingtotrue, andresavetofalse. - 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.expiresin 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.expiresis not updated. - Quit the web app, and change the value of
express-session'sresaveconfig option totrue. - Restart the web app.
- Load a page again.
- Note the session info in the DB, specifically the
session.cookie.expiresvalue. - Reload the page.
- Finally, note the session info in the DB, specifically that the
session.cookie.expiresvalue 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