Sessions that work across replicas: SESSION_BACKEND=cookie #109

Merged
jcoffey-dev merged 2 commits from feat/cookie-sessions into main 2026-11-18 15:56:21 +00:00
2 Commits
Author SHA1 Message Date
jcoffey-dev c0768358f2 Sign-out revokes the session's tokens at the mail server
ci / node (pull_request) Skipped
ci / version (pull_request) Skipped
ci / docker-build (pull_request) Skipped
ci / publish (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 2m4s
ci / announce (pull_request) Skipped
With cookie sessions there is nothing on this side to delete, so signing
out (one account or all) now revokes the refresh and access token through
the server's RFC 7009 endpoint, read from its OAuth metadata. A copy of
the cookie then gets 401. A server without revocation still signs out,
and in cookie mode a warning says the copy works until the tokens expire.

Closes #104
2026-11-18 01:33:35 -07:00
jcoffey-dev c8e03fd00f Sessions that work across replicas: SESSION_BACKEND=cookie
ci / node (pull_request) Skipped
ci / version (pull_request) Skipped
ci / docker-build (pull_request) Skipped
ci / publish (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 2m23s
ci / announce (pull_request) Skipped
A second SessionBackend that seals the whole session into its cookie
(s1.<kid>.<sealed>, AES-256-GCM under a key derived from APP_SECRET), so any
replica can serve a session it never issued and the webmail keeps no state
of its own. The default stays the in-memory store with SESSION_FILE.

- Cookie mode needs APP_SECRET set explicitly and OAuth sign-in; it refuses
  to start otherwise. A sealed password couldn't be revoked.
- Token renewal and sliding expiry re-issue the cookie, for the account in
  front and for the other signed-in accounts in the _more cookie.
- APP_SECRET_PREVIOUS opens cookies sealed before a rotation and re-seals
  them under the current key.
- The session list can't reach other sessions in this mode: the API says
  enumerable: false, the Security page shows only this device and hides
  "Sign out all other sessions". Changing the password still signs out
  everywhere, through the server.
- The _more cookie accepts the new shape and stays under 3,800 bytes.

One new string, translated in all ten catalogs.
2026-11-17 23:43:01 -07:00