Skip to content

Set-Cookie is not updated after changing cookie config even when rolling is set to true #1077

Description

@Desentso

Environment information

Version: 1.18.2

Platform: All

Node.js version: v22.17.1

Any other relevant information: -

What steps will reproduce the bug?

Config I'm using:

app.use(expressSession({
  secret: '...', 
  name: "sessionId",
  store: new (require('connect-pg-simple')(expressSession))(),
  cookie: {
    httpOnly: true,
    secure: true,
    domain: "example.com",
    sameSite: "none",
    maxAge: 7 * 24 * 60 * 60 * 1000 // 7 days
  },
  proxy: true,
  resave: false, 
  saveUninitialized: false,
  rolling: true,
}));

If I change e.g. sameSite to "strict", or change maxAge, this only applies to brand new sessions. I would expect that with rolling: true, these changes would apply to existing cookies too when the user next time uses the app.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions