v1.10.90-0e025b8
Skip to main content
← Back to Glossary

Sticky Session

Performance

Definition

A sticky session maintains the same IP address for a defined period, allowing multiple sequential requests to originate from the same IP and preserving session state.

What is a Sticky Session?

A sticky session, also called session affinity, is a proxy configuration that maintains the same IP address for a defined period or until explicitly released. This allows multiple sequential requests to originate from the same IP, preserving session state on the target website.

How Session Binding Works at the Gateway

When a sticky session is established, the proxy gateway locks a specific IP from the pool to your connection for a configurable duration, typically ranging from 1 to 30 minutes. All requests during this window route through the same IP. The session can be identified by a session ID, port number, or cookie. When the sticky period expires or the session is released, a new IP is assigned for the next session. This mechanism balances the benefits of rotation with the need for IP consistency.

On Hex Proxies, you append a session ID to your credentials when connecting to gate.hexproxies.com:8080. All requests sharing that session ID exit through the same IP until the TTL expires, then the gateway seamlessly assigns a fresh IP.

When Session Continuity Is Non-Negotiable

Many web tasks require multiple requests from the same IP to complete: multi-page checkout flows, form submissions, paginated data collection, and authenticated browsing. Without sticky sessions, each request coming from a different IP would break session continuity and trigger security alerts. Hex Proxies provides configurable sticky sessions across residential and datacenter pools.

Why It Matters for Proxy Users

Sticky sessions bridge the gap between per-request rotation and fully static IPs. They give you session continuity for multi-step workflows while still allowing periodic IP refreshes. Choosing the right TTL is critical: too short and sessions break mid-flow, too long and the IP accumulates too many requests on a single target, increasing block risk.

**Practical example:** A data collection pipeline scrapes paginated product listings, where each page requires a session cookie set on the first page. The pipeline configures Hex Proxies with a 10-minute sticky session per scraping thread. Each thread maintains the same IP across all pagination requests for a given product category, preserving the session cookie. After 10 minutes or when the category is complete, the thread gets a fresh IP for the next category, keeping per-IP request counts low while maintaining session integrity throughout each paginated crawl.

A common pitfall with sticky sessions is creating more session IDs than necessary. Each unique session ID pins a separate IP from the pool. If your application generates a new session ID per request by accident, the sticky session mechanism degenerates into per-request rotation, wasting the session continuity you intended to maintain. Verify that session IDs are reused correctly within each workflow unit.

Put Your Knowledge Into Practice

Explore proxy plans optimized for your workflow.