Solution

Keep every user session on the right backend

9 persistence methods, from source-IP hashing to SAM — TR7's configurable cookie engine with 4 cookie sources, 4 session formats, 4 security flags

Shopping carts, logged-in dashboards, banking sessions, RDP gateways — once a user starts a stateful flow, every follow-up request needs to land on the same backend. Source-IP works until users sit behind NAT. Plain cookies work until they get stripped. TR7 ADC ships 9 persistence methods so the right one is always available — picked per vService, no compromise.

9
Session persistence methods shipped
2 × 4 × 4
SAM cookie source × session format × security flag combinations
per vService
Persistence method — change live without restart

When load balancing breaks sessions

Round-robin sends each request to a different backend — by design. For stateless services that's perfect. But the moment a user logs in, fills a cart, or starts a remote desktop, the application starts holding state on one specific backend. If request #2 lands on a different one, the user sees an empty cart, a logged-out screen, or a frozen RDP session.

Session persistence (or 'affinity') solves this by pinning a user to a chosen backend for the duration of the session. The catch: there's no single right way to pin. Source-IP works for unique-IP users but breaks behind corporate NAT. Cookies work in browsers but not for raw TCP. URL-parameter hash works for stateless URLs but not for user-scoped flows. Each method is right somewhere.

The answer is to ship every method and pick per vService.

Pick the persistence method, per vService

Each vService picks its persistence method from a dropdown — alongside its load-balancing algorithm. Both layers are independent: choose Fastest+ for backend selection and a TR7 cookie for affinity, or round-robin with source-IP, or whatever combination fits the workload. Method choice is hot-swap, no restart.

9 methods shipped

Five self-persistent load-balancing algorithms (source, URI, URL-param, header, RDP-cookie) plus four explicit persistence methods (TR7 cookie, backend cookie, dynamic, SAM). Cover every common case.

SAM — full cookie control

Session Affinity Manager lets you set the cookie source (TR7-generated or backend-generated), session format (UUID, IP-timestamp-random, IP-random, custom), and security flags (HttpOnly, Secure, SameSite=Strict/Lax) — without touching backend code.

Composable with any ADC algorithm

Persistence runs on top of the load-balancing algorithm: the algorithm picks the backend for the first request, persistence pins the rest. Fastest+ for cold-start, sticky cookie for the session — works together.

Hot-swap (no restart)

Change persistence method on a live vService and new sessions adopt the new method immediately. Existing pinned sessions continue undisrupted until they expire.

9 session persistence methods shipped

Pick the method that fits the protocol, the client population, and the application's session model. All 9 available per vService — no code, no plugin.

Source-IP

Same client IP always lands on the same backend. Simple, code-free, works for any protocol. Best when client IPs are diverse — breaks down behind shared NAT or corporate proxies.

URI-length hash

Hash on the URL length distributes load by URL complexity while pinning identical URLs to the same backend. Useful for cache-affinity scenarios.

URL-parameter hash

Hash on a specific query parameter (e.g. ?user_id, ?session_token). Routes the same user-scoped request to the same backend without requiring cookies.

Header hash

Hash on a custom HTTP header. Useful when the upstream caller injects tenant or correlation IDs, or for header-based A/B routing.

RDP cookie

Read the RDP session cookie embedded in the protocol negotiation. Required for RDP gateways and remote-desktop farms — keeps users on the same RDP host after reconnect.

TR7 cookie

TR7 ADC generates and manages the affinity cookie itself — no backend code required. Operator sets the cookie name and a max-idle timeout; the ADC reads it on every request, the backend ignores it. Easiest persistence to bolt onto a legacy app.

Backend cookie

Use the application's own session cookie for affinity — operator names the cookie (PHPSESSID, JSESSIONID, app-id, anything custom) and TR7 ADC reads the existing value. No new cookies added. Right when the application already tracks sessions and you don't want to layer a second cookie.

Dynamic persistence

Hash-key persistence table maintained in memory. Each entry maps a key — any combination of request headers, cookies, source IP, or URL parameters — to a backend. Operator sets the table size (10K to 100M entries, default 3M) and the entry expire time. Use when persistence rules need to be more flexible than a single fixed cookie or header.

SAM — Session Affinity Manager

The advanced cookie-based persistence engine. Choose who generates the cookie, the session-id format, and the security flags — all from the UI, no backend changes. See details below.

SAM — Session Affinity Manager

SAM is TR7's most flexible persistence method. Where a plain cookie pins a session, SAM lets you control every property of that cookie from a dropdown — without backend changes, without writing rule code.

01

Two cookie sources

Choose who generates the affinity cookie: TR7-generated (default — no backend involvement) or backend-generated (use the application's existing session cookie). Switch between them without breaking active sessions.

02

Four session-ID formats — including a wide-open Custom mode

Session identifier format options: UUID (random 128-bit), IP-timestamp-random (traceable, time-ordered), IP-random (anonymous within a tenant), or Custom. Custom mode opens the full traffic variable surface — combine any request headers, cookies, URL components, TLS session info, source IP (raw or masked), JWT claims, query parameters, and even request body fields with operator-defined transform functions (masking, hashing, substring extraction, case normalization, concatenation). The same variable-and-transform engine drives Dynamic persistence hash keys. See the spotlight below for real-world combinations.

03

Four security flag combinations

Cookie security flags: HttpOnly (no JavaScript access — XSS protection), Secure (HTTPS-only), SameSite=Strict (no cross-site sending — CSRF protection), SameSite=Lax (compatibility-friendly variant). Combine as needed.

04

Operator-configurable, no code

Everything above is a per-vService dropdown in the SAM panel. No custom rule code, no backend integration, no separate WAAP rule for cookie handling. SAM is a configuration, not a script.

Custom Format & Hash flexibility

Beyond cookies and IP — combine any traffic variable

SAM Custom Format and Dynamic persistence hash keys accept every traffic variable TR7 ADC sees — combine them, transform them, build the exact persistence rule your application needs

SAM Custom Format — real-world combinations

TLS session ID + masked /24 source IP — keep mobile users pinned to the same backend through TLS resumption even when their IP shifts within a carrier subnet (cell tower handoff)
JWT claim (after decode) + tenant header — multi-tenant SaaS where each tenant's authenticated users route to their own dedicated backend cluster, decoded from the token itself
User-Agent fragment + Accept-Language — separate desktop-EN cohorts from mobile-TR cohorts onto different backend pools without app changes
TLS SNI server name + URL path prefix — multi-app SNI hosting where the SNI determines which app, the path prefix determines which instance — single ADC, many tenants
Geo-IP country + first URL segment — geographic content routing that's also structurally aware of which section of the site is being requested

Dynamic persistence — multi-variable hash keys

IP /24 + URL path prefix — geographic cache affinity tied to URL structure (CDN-friendly without a CDN)
Header value + lowercase query parameter — case-insensitive multi-region routing where ?user=Alice and ?user=alice land on the same backend
HTTP method + content-type — route HTTP/2 POSTs to API-tuned backends and HTTP/1.1 GETs to static-asset backends from one vService
Cookie substring + IP class — partial legacy cookie pattern matching when the app uses non-standard cookie shapes
Request body field hash + auth header — for SOAP and legacy APIs where the session identifier lives in the body, not in headers or cookies

Transform functions on any variable

IP address masking — /8, /16, /24, or arbitrary prefix-length masking for cohort-level subnet routing
Substring extraction via regex — pull a specific fragment from a header, cookie, or URL (e.g. extract just the tenant-id prefix from a longer JWT)
Case normalization — lowercase or uppercase before hashing for case-insensitive routing across mixed clients
Cryptographic hash (MD5, SHA) — produce opaque, fixed-length session IDs from sensitive source variables — the underlying data never leaves the platform
String concatenation with operator-defined separators — combine any number of variables with custom delimiters for unique compound keys

When persistence matters most

E-commerce carts and checkout

Users add items across multiple page loads. Backend cookie or TR7 cookie keeps the cart state on one backend — checkout never sees an empty cart.

Authenticated dashboards

Logged-in sessions where the user's permission cache lives on one backend. SAM with TR7-generated cookie + HttpOnly + Secure works without backend code changes.

RDP gateways and remote-desktop farms

RDP sessions must reconnect to the same host. RDP cookie persistence reads the protocol-native session ID — no extra config, no cookie injection.

Legacy apps without session management

Applications that don't track sessions themselves. Source-IP or URL-parameter persistence pins users without requiring code changes to the legacy app.

Common questions

Do I have to pick between load-balancing algorithm and persistence?
No — both layers run independently. The load-balancing algorithm picks the backend for the first request in a session; persistence then pins all follow-up requests to that backend until the session ends. Use any algorithm (round-robin, Fastest+, etc.) with any persistence method.
What's the difference between TR7 cookie and SAM?
TR7 cookie is a simple default — TR7 ADC generates an opaque affinity cookie, sets sensible defaults, and pins sessions. SAM is the same idea but with operator control over every cookie property: source, session-ID format, security flags. Use TR7 cookie for the common case; use SAM when you need fine-grained control without backend changes.
What happens when the pinned backend fails?
TR7 ADC's health monitoring detects the failure and removes the backend from the vService. Existing sessions pinned to that backend are re-routed to a healthy one — the user may need to re-authenticate or refresh their cart, but the platform doesn't blackhole the traffic.
Can I use source-IP persistence behind a corporate NAT?
Source-IP works when client IPs are diverse — every user has a different visible IP. Behind a shared NAT (corporate office, mobile carrier, CGNAT) all users appear with the same IP, and source-IP would pin them all to the same backend. For NAT-heavy traffic, prefer cookie-based persistence (TR7 cookie, SAM, or backend cookie) or a hash on a per-user header or URL parameter.
Does session persistence affect WebSocket and HTTP/2 connections?
Long-lived connections (WebSocket, HTTP/2 streams) stay on the backend they originally connected to — they're naturally sticky for the lifetime of the connection. Persistence becomes relevant when the same user opens a new connection and needs to land on the same backend as before.

Match the persistence method to your workload

See how 9 persistence methods cover every common case — from RDP gateways to legacy apps to SAM-controlled cookies.