Skip to content

session persistence: always set cookie Path to / - #9950

Open
zhaohuabing wants to merge 3 commits into
envoyproxy:mainfrom
zhaohuabing:session-cookie-path-root
Open

session persistence: always set cookie Path to /#9950
zhaohuabing wants to merge 3 commits into
envoyproxy:mainfrom
zhaohuabing:session-cookie-path-root

Conversation

@zhaohuabing

@zhaohuabing zhaohuabing commented Sep 4, 2026

Copy link
Copy Markdown
Member

The session persistence cookie was scoped to the matched HTTPRoute path, so it was never sent back when the client-visible path differs from the path Envoy matches, e.g. when an edge proxy rewrites / to /foo/bar before the request reaches the gateway.

The GEP-1619 spec was changed in kubernetes-sigs/gateway-api#5046: the cookie Path now defaults to / instead of being derived from the route match, and a new cookieConfig.path field lets users override it. This PR follows the new default. The explicit path field is not in Gateway API 1.6.2 yet, so wiring the override is left for the 1.7 bump.

This is a breaking change: the cookie is now sent to every route on the same host, so HTTPRoute rules on the same host that enable cookie-based session persistence must use distinct sessionName values. Rules sharing a sessionName used to get separate cookies because their paths differed; they now overwrite each other's cookie. The release note and the session persistence task doc call this out.

Related to #8580

@zhaohuabing
zhaohuabing requested a review from a team as a code owner September 4, 2026 09:35
@netlify

netlify Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit c0b65f4
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a9a97df84779e0008a6b24b
😎 Deploy Preview https://deploy-preview-9950--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.33%. Comparing base (0988daa) to head (c0b65f4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9950      +/-   ##
==========================================
+ Coverage   81.30%   81.33%   +0.02%     
==========================================
  Files         264      264              
  Lines       40967    40953      -14     
==========================================
  Hits        33310    33310              
+ Misses       7656     7642      -14     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The session persistence cookie was scoped to the matched HTTPRoute path,
so it was never sent back when the client-visible path differs from the
path Envoy matches, e.g. when an edge proxy rewrites / to /foo/bar before
the request reaches the gateway. GEP-1619 now defaults the cookie Path to
/ instead of deriving it from the route match, so follow that guidance.

Fixes envoyproxy#8580

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
… unset

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
@zhaohuabing
zhaohuabing force-pushed the session-cookie-path-root branch from 7254f18 to c0b65f4 Compare September 4, 2026 10:05
@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

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