Proxy Basics

What is a Sticky Session? Proxy Session Persistence

V
VeProxy Team
· · 5 min read · 464 views

Last updated: 2026-02-12

Quick Definition

A sticky session (also called session persistence) is a proxy configuration that maintains the same IP address across multiple requests for a specified duration. Unlike per-request rotation where each connection gets a new IP, sticky sessions preserve IP continuity—essential for operations where websites track user identity through IP address, such as login flows, shopping cart checkouts, and multi-page forms.

How Sticky Sessions Work

Sticky sessions use a session identifier to bind multiple requests to the same backend IP:

Sticky Session Flow:
┌────────────────────────────────────────────────────────────────┐
│ Session ID: "user123-session-abc"                              │
│ Duration: 10 minutes                                           │
│ Assigned IP: 98.45.123.67                                      │
├────────────────────────────────────────────────────────────────┤
│                                                                │
│ 00:00 - Request 1 (Login page)     → IP: 98.45.123.67         │
│ 00:01 - Request 2 (Submit login)   → IP: 98.45.123.67  ✓ Same │
│ 00:03 - Request 3 (Dashboard)      → IP: 98.45.123.67  ✓ Same │
│ 00:05 - Request 4 (Profile page)   → IP: 98.45.123.67  ✓ Same │
│ 00:09 - Request 5 (Settings)       → IP: 98.45.123.67  ✓ Same │
│                                                                │
│ 00:10 - Session expires                                        │
│                                                                │
│ 00:11 - Request 6 (new session)    → IP: 176.23.89.201  New   │
└────────────────────────────────────────────────────────────────┘

Without Sticky Session (Per-Request Rotation):
┌────────────────────────────────────────────────────────────────┐
│ 00:00 - Request 1 (Login page)     → IP: 98.45.123.67         │
│ 00:01 - Request 2 (Submit login)   → IP: 176.23.89.201  ✗     │
│         Website: "IP changed! Session invalid. Re-login."     │
└────────────────────────────────────────────────────────────────┘

The proxy gateway maintains a mapping table:

  • Session ID: Unique identifier you provide (or auto-generated)
  • Assigned IP: Backend IP bound to this session
  • Expiry Time: When the binding will be released
  • Geographic Filter: Country/city constraints if specified

Session Duration Options

Duration Typical Use Case Considerations
1 minute Quick form submissions Minimal exposure if IP flagged
5 minutes Short multi-page flows Good for quick operations
10 minutes Standard browsing sessions Most common default
30 minutes Complex checkout processes Extended identity continuity
60 minutes Long account sessions Maximum offered by most providers
Custom/Unlimited Dedicated use cases Usually requires static IP product

Implementation Methods

Method 1: Session ID in Username
─────────────────────────────────────────────────────────────────
Proxy: gateway.provider.com:8000
Username: user-session-abc123xyz
Password: your_password

All requests with session ID "abc123xyz" use the same IP
until timeout. Change the session ID to get a new IP.

Method 2: Dedicated Session Port
─────────────────────────────────────────────────────────────────
Port 8000: Per-request rotation (default)
Port 8001: 5-minute sticky session
Port 8002: 10-minute sticky session
Port 8003: 30-minute sticky session

Method 3: HTTP Header
─────────────────────────────────────────────────────────────────
X-Session-ID: my-unique-session-id
Gateway reads header and maintains session binding.

Method 4: API-Based Session Management
─────────────────────────────────────────────────────────────────
POST /api/sessions
{
  "session_id": "my-session",
  "duration_minutes": 15,
  "country": "US"
}

Response:
{
  "session_id": "my-session",
  "assigned_ip": "98.45.123.67",
  "expires_at": "2026-02-01T15:45:00Z"
}

Key Technical Considerations

Factor Impact Recommendation
Session ID Uniqueness Same ID = same IP; different ID = different IP Use unique IDs per logical session
Expiry Handling New IP after timeout may break cookies Complete operations within duration
IP Availability Requested IP may become unavailable Handle IP change gracefully
Geographic Consistency New session may get different location Specify geo-targeting with session
Concurrent Sessions Multiple sessions can run in parallel Each session ID is independent

Common Use Cases

Use Case Why Sticky Session Duration
User login flows IP change triggers security alerts 10-30 minutes
E-commerce checkout Cart/payment tied to session IP 30-60 minutes
Form submissions Multi-step forms track IP 5-10 minutes
Account creation Signup flow checks IP consistency 10-15 minutes
Session-based scraping Need to maintain logged-in state 10-30 minutes
Social media browsing Platform tracks user IP 30-60 minutes

Sticky Session vs Static IP

Aspect Sticky Session Static IP (Dedicated)
Duration Minutes (1-60) Months (subscription length)
IP Assignment Random from pool Same IP always
Cost Model Per GB or request Per IP per month
IP Control Cannot choose specific IP Your dedicated IP
Best For Short sessions, many identities Long-term accounts, consistent identity

Test your sticky session configuration using the IP Checker tool across multiple requests. Verify connection stability with the Proxy Tester.

FAQ

What happens when a sticky session expires?

When the session timeout is reached, the IP binding is released. Your next request will receive a new IP from the pool. If you need to maintain the same IP, either extend the session before expiry (if supported) or switch to a static/dedicated IP product for permanent assignment.

Can I extend a sticky session before it expires?

Behavior varies by provider. Some reset the timer on each request (sliding expiration), while others use a fixed timeout from session creation. Check your provider's documentation—making any request within the session often extends it automatically.

How many concurrent sticky sessions can I have?

Most providers allow unlimited concurrent sessions—each with a unique session ID gets its own IP binding. You could run 100 different sessions simultaneously, each maintaining its own persistent IP.

What if I need the same IP across different days?

Sticky sessions are designed for short-term persistence (minutes to hours). For multi-day or permanent IP assignment, you need a static IP product (ISP proxy or dedicated datacenter IP) where the IP is exclusively assigned to your account.

Can I force a new IP while keeping the same session ID?

Most providers require a new session ID to get a new IP. Some offer API endpoints to explicitly rotate an existing session. If you need a fresh IP, the simplest approach is to generate a new session ID (e.g., append a timestamp or counter).

Do sticky sessions work with all proxy types?

Sticky sessions are primarily available with rotating residential and rotating mobile proxies. Datacenter proxies often offer static IPs instead. The concept doesn't apply to static/dedicated IPs since they're always persistent by nature.

Related Tools

Share this article

Ready to start scraping?

Get access to millions of residential proxies across 195+ countries. Instant activation.

Get Started Now