Skip to content

fix: isolate session cookie option overrides#324

Merged
mcollina merged 1 commit intomainfrom
fix/session-options-state-isolation
Mar 8, 2026
Merged

fix: isolate session cookie option overrides#324
mcollina merged 1 commit intomainfrom
fix/session-options-state-isolation

Conversation

@mcollina
Copy link
Copy Markdown
Member

@mcollina mcollina commented Mar 8, 2026

Summary

  • isolate cookie option state per session by cloning cookie options in Session
  • keep per-session session.options() overrides local to that session instead of mutating shared plugin options
  • preserve override behavior across reload/regenerate without leaking stale/expired absolute cookie expiration values
  • add regression tests for cross-session isolation and missing maxAge getter branch coverage

Context

This addresses a real bug where session.options() could mutate shared cookie option state. A route still needs to pass untrusted input into session.options() for security impact, so this fix is framed as state isolation correctness and hardening.

Testing

  • npm test
  • npm run test:typescript

Copy link
Copy Markdown
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 353a79d into main Mar 8, 2026
17 checks passed
@mcollina mcollina deleted the fix/session-options-state-isolation branch March 8, 2026 21:20
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.

2 participants