Http Traffic Management
sticky_sessions
Sticky sessions HTTP filter.
On this page
Sticky sessions HTTP filter.
Configuration Notes
On request: looks up session store for pinned endpoint, sets ctx.pinned_endpoint_address. On response: injects session cookie or learns session ID from upstream.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
clusters | ClusterSessionConfig[] | yes | Per-cluster session persistence configurations. |
clusters[].name | string | yes | Cluster name this config applies to. |
clusters[].type | cookie | header | learn | yes | Session persistence mode: cookie injects cookies, header reads a request header, learn observes the upstream Set-Cookie response header only. |
clusters[].cookie_name | string | one of | Cookie name used to store the session ID. |
clusters[].cookie_attributes | CookieAttributes | one of | Cookie attributes for the Set-Cookie header. |
clusters[].cookie_attributes.domain | string | no | Domain attribute. |
clusters[].cookie_attributes.path | string | no | Path attribute. |
clusters[].cookie_attributes.http_only | bool | no | HttpOnly flag. |
clusters[].cookie_attributes.secure | bool | no | Secure flag. |
clusters[].cookie_attributes.same_site | Strict | Lax | None | no | SameSite attribute. |
clusters[].header_name | string | one of | Header name to read the session key from. |
clusters[].cookie_name | string | one of | Cookie name to observe in upstream responses. |
clusters[].ttl_secs | integer | no | Idle timeout for session entries in seconds (sliding TTL). The binding expires after this many seconds of inactivity. |
clusters[].failover | bool | no | Re-pin to a healthy endpoint when the pinned one is unhealthy. |
clusters[].max_entries | MaxEntries | no | Maximum number of session entries in the store. |
clusters[].eviction | lru | ttl | no | Eviction policy when at capacity. |
clusters[].storage | local | yes | Where session bindings are stored. |
Example
filter: sticky_sessions
clusters:
- name: app_backend
type: cookie
cookie_name: "_praxis_route"
ttl_secs: 3600
cookie_attributes:
path: "/"
http_only: true
secure: true
same_site: Lax
failover: true
max_entries: 100000
eviction: lru
storage: local