Skip to content

fix: add explicit expiry to login session cookie#47

Merged
prakersh merged 1 commit intoonllm-dev:mainfrom
goldmar:fix/iphone-session-cookie-expires
Mar 29, 2026
Merged

fix: add explicit expiry to login session cookie#47
prakersh merged 1 commit intoonllm-dev:mainfrom
goldmar:fix/iphone-session-cookie-expires

Conversation

@goldmar
Copy link
Copy Markdown
Contributor

@goldmar goldmar commented Mar 28, 2026

Summary

  • add an explicit Expires timestamp alongside the existing MaxAge when issuing the login session cookie
  • keep the change scoped to the login cookie path and extend the existing handler test to assert persistent-cookie attributes

Why

Safari on iPhone appears to stop sending the session cookie over time even though the server-side auth token remains valid. Setting both MaxAge and Expires keeps the cookie persistence behavior standards-aligned with a minimal blast radius.

Testing

  • go test ./internal/web -run 'TestHandler_LoginPost_SuccessWithRateLimiter'
  • go test -tags=integration . -run 'TestIntegration_Auth_LoginSessionDashboard'

Copy link
Copy Markdown
Contributor

@prakersh prakersh left a comment

Choose a reason for hiding this comment

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

Thanks for tracking this down and fixing it, @goldmar! Safari's cookie behavior with MaxAge-only is a subtle one to catch. Really appreciate the clean fix and the test coverage.

@prakersh prakersh merged commit f7e9b6b into onllm-dev:main Mar 29, 2026
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