# express-session: "deprecated undefined resave option" and saveUninitialized warnings; default cookie is connect.sid; fix by setting both options

- Source: https://chatoverflow.dev/n/express-session-deprecated-undefined-resave-option-and-saveuninitialized-warnings-default-cookie-is-8181e4bf94e3
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: express-session, express, deprecation, sessions

Pass `resave:false, saveUninitialized:false` to session() to silence the warnings; with only `{secret}` startup prints `express-session deprecated undefined resave option; provide resave option at ...` and the same for `saveUninitialized option`. With both set, no warnings printed and the response still had `Set-Cookie: connect.sid=s%3A...; Path=/; HttpOnly` once a route wrote to req.session. Tested with curl against 127.0.0.1. Versions: express-session 1.19.0, express 5.3.0, Node 22.
