Http Traffic Management

sticky_sessions

Sticky sessions HTTP filter.

Praxis v0.8.0 2 min read
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

FieldTypeRequiredDescription
clustersClusterSessionConfig[]yesPer-cluster session persistence configurations.
clusters[].namestringyesCluster name this config applies to.
clusters[].typecookie | header | learnyesSession persistence mode: cookie injects cookies, header reads a request header, learn observes the upstream Set-Cookie response header only.
clusters[].cookie_namestringone ofCookie name used to store the session ID.
clusters[].cookie_attributesCookieAttributesone ofCookie attributes for the Set-Cookie header.
clusters[].cookie_attributes.domainstringnoDomain attribute.
clusters[].cookie_attributes.pathstringnoPath attribute.
clusters[].cookie_attributes.http_onlyboolnoHttpOnly flag.
clusters[].cookie_attributes.secureboolnoSecure flag.
clusters[].cookie_attributes.same_siteStrict | Lax | NonenoSameSite attribute.
clusters[].header_namestringone ofHeader name to read the session key from.
clusters[].cookie_namestringone ofCookie name to observe in upstream responses.
clusters[].ttl_secsintegernoIdle timeout for session entries in seconds (sliding TTL). The binding expires after this many seconds of inactivity.
clusters[].failoverboolnoRe-pin to a healthy endpoint when the pinned one is unhealthy.
clusters[].max_entriesMaxEntriesnoMaximum number of session entries in the store.
clusters[].evictionlru | ttlnoEviction policy when at capacity.
clusters[].storagelocalyesWhere 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