Skip to content

fix: refresh cookie options for rolling sessions#1120

Open
raashish1601 wants to merge 1 commit into
expressjs:masterfrom
raashish1601:codex/rolling-cookie-options
Open

fix: refresh cookie options for rolling sessions#1120
raashish1601 wants to merge 1 commit into
expressjs:masterfrom
raashish1601:codex/rolling-cookie-options

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

Refresh cookie options from the current middleware configuration when an existing session is loaded with rolling: true.

This keeps rolled Set-Cookie headers in sync after deployments that change cookie settings such as sameSite or maxAge, while preserving the existing session id and store entry.

Fixes #1077.

Validation

  • npx mocha --require test/support/env --check-leaks --no-exit --reporter spec --grep "rolling option" test/session.js
  • npx eslint index.js test/session.js
  • bash -lc "tr -d '\r' < test/support/gencert.sh | bash"
  • npx mocha --require test/support/env --check-leaks --no-exit --reporter spec test/
  • npm run lint
  • git diff --check

npm test itself cannot be launched from this Windows shell because the npm script starts with ./test/support/gencert.sh, which cmd rejects as '.' is not recognized. I ran the certificate script through bash after stripping checkout CRLFs, then ran the full mocha suite directly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant