Skip to content

feat: Add configurable cookie Domain for cross-subdomain sessions - #118

Merged
m-t-a97 merged 1 commit into
mainfrom
feat/cookie-domain
Sep 14, 2026
Merged

m-t-a97 merged 1 commit into
mainfrom
feat/cookie-domain

Conversation

@m-t-a97

@m-t-a97 m-t-a97 commented Sep 14, 2026

Copy link
Copy Markdown
Member

Cookies were always host-only, so a session issued by api.example.com was never sent to app.example.com. Add session.domain (and the AUTHULA_COOKIE_DOMAIN env var) and apply it to the session, CSRF, TOTP and impersonation cookies on both set and clear. The value is validated against BaseURL at startup since net/http silently drops invalid domains.

Also fix CSRF and admin cookie clears that did not mirror the attributes they were set with, and consolidate SameSite parsing in util.ParseSameSite.

Cookies were always host-only, so a session issued by api.example.com was
never sent to app.example.com. Add `session.domain` (and the
`AUTHULA_COOKIE_DOMAIN` env var) and apply it to the session, CSRF, TOTP
and impersonation cookies on both set and clear. The value is validated
against BaseURL at startup since net/http silently drops invalid domains.

Also fix CSRF and admin cookie clears that did not mirror the attributes
they were set with, and consolidate SameSite parsing in util.ParseSameSite.
@m-t-a97 m-t-a97 self-assigned this Sep 14, 2026
@m-t-a97
m-t-a97 merged commit 4d1e2bf into main Sep 14, 2026
6 checks passed
@m-t-a97
m-t-a97 deleted the feat/cookie-domain branch September 14, 2026 00:54
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.

1 participant