2
0
Fork 0

feat: expire sessions after inactivity #38

Merged
aleksei merged 1 commit from feat/idle-session-expiry into main 2026-11-16 22:14:29 +00:00
Owner

Summary

  • Sessions now store their last activity time instead of their creation time.
  • Every authenticated request refreshes the idle deadline, so an open portal with its two-second /api/tree poll stays signed in.
  • A session is removed only when it has been idle for longer than sessionTtlHours (24 hours by default).
  • The browser cookie gets a persistent 400-day Max-Age because it must outlive the server-side idle timeout. The server remains the source of truth and rejects an idle session even if the browser still has the token.
  • README and the auth/config/deploy/notification ADRs document the idle-timeout semantics.

Test plan

  • cargo test --workspace
  • Added activity_extends_the_session
  • Extended the cookie test to cover the persistent Max-Age
## Summary - Sessions now store their last activity time instead of their creation time. - Every authenticated request refreshes the idle deadline, so an open portal with its two-second `/api/tree` poll stays signed in. - A session is removed only when it has been idle for longer than `sessionTtlHours` (24 hours by default). - The browser cookie gets a persistent 400-day `Max-Age` because it must outlive the server-side idle timeout. The server remains the source of truth and rejects an idle session even if the browser still has the token. - README and the auth/config/deploy/notification ADRs document the idle-timeout semantics. ## Test plan - `cargo test --workspace` - Added `activity_extends_the_session` - Extended the cookie test to cover the persistent `Max-Age`
A session now stores its last activity time instead of its creation time. Every authenticated request refreshes the deadline, so an open portal with its two-second tree poll stays signed in. The browser cookie gets a persistent max-age because it must outlive the server-side idle timeout; the server still rejects a session that has been idle for longer than sessionTtlHours.
aleksei deleted branch feat/idle-session-expiry 2026-11-16 22:14:29 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zoo/mux-portal!38
No description provided.