feat: Support __Host- prefixed session cookies for sticky sessions#549
Merged
hoffmaen merged 3 commits intocloudfoundry:developfrom Apr 13, 2026
Merged
feat: Support __Host- prefixed session cookies for sticky sessions#549hoffmaen merged 3 commits intocloudfoundry:developfrom
hoffmaen merged 3 commits intocloudfoundry:developfrom
Conversation
a18e
reviewed
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__Host--prefixed variants of configured sticky session cookie names (e.g.__Host-JSESSIONID), both in application responses and client requests__Host-) per RFC 6265bis, which mandates this canonical casing for user agents — no case-insensitive matching needed__Host-prefix is handled automatically for every name inrouter.sticky_session_cookie_namesMotivation
The
__Host-cookie prefix ensures that session cookies are bound to the exact origin host and are never sent to subdomains, preventing session cookie leakage to other applications on shared domains. This prefix also enforces that cookies are only set over HTTPS, without aDomainattribute, and withPath=/— supporting it in gorouter's sticky session handling allows applications to leverage these stricter security guarantees while retaining session affinity.Backward Compatibility
Breaking Change? No
Note on AI usage
Parts of this code and tests were developed with assistance from Claude Code (claude-opus-4-20250514).