Skip to content

HTTPRoute sessionPersistence: allow overriding cookie Path attribute #8580

@zhaohuabing

Description

@zhaohuabing

Description:

Envoy Gateway currently derives the session persistence cookie Path from the matched HTTPRoute path.
This becomes a problem when traffic is rewritten at an edge layer before it reaches Envoy Gateway.

Example flow:

  1. A client sends a request to https://example.com/
  2. An upstream edge/proxy rewrites that request to https://example.com/foo/bar
  3. Envoy Gateway matches the rewritten path /foo/bar
  4. sessionPersistence sets a cookie with Path=/foo/bar
  5. On the next request to https://example.com/, the browser does not send that cookie back because cookie path matching does not include /
  6. As a result, sticky sessions break even though the user-facing URL is still rooted at /.

Possible workaround:

  • Enhance sessionPersistence in HTTPRoute to add support for modifying Path attribute - this needs Gateway API upstream change
  • Add a similar config in BackendTrafficPolicy  to allow for more flexibility of updating cookie attributes like here

[optional Relevant Links:]

Any extra documentation required to understand the issue.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions