Glossary Proxy features
Sticky session
Sticky session: A sticky session keeps the same exit IP from a rotating proxy pool for a set period, such as 10 or 30 minutes, so logins, carts and other multi-step tasks are not broken by IP changes.
Also called: sticky IP, session control, persistent session
Key takeaways
- A session ID in the proxy username ties your requests to one exit IP.
- Sessions last for a set time, commonly 1 to 30 minutes, sometimes longer.
- On residential networks a session can end early when the home device goes offline.
- Use sticky sessions for any flow where a site links requests to one visitor.
- For the same IP over days or months, use a static ISP proxy instead.
What is a sticky session?
On a rotating proxy network, every request can leave from a different IP. That is great for spreading load and terrible for anything stateful. A sticky session tells the gateway: keep sending my requests through the same exit node until I say otherwise or the time runs out.
The term comes from load balancing, where “sticky sessions” keep a user on the same backend server. In proxies, it means keeping a user on the same exit IP.
How to create one
Most providers use parameters in the proxy username. A typical pattern:
user-country-gb-session-7f3a91-sesstime-15:[email protected]:7777
session-7f3a91is any string you choose. Reuse it to stay on the same IP; change it to get a new one.sesstime-15asks for up to 15 minutes.- Some providers use dedicated ports for sticky sessions instead, or an API to create a session.
How long sticky sessions last
| Network type | Typical options | What ends a session early |
|---|---|---|
| Residential | 1 to 30 minutes, some up to 24 hours | Device goes offline, network changes |
| Mobile | Minutes to hours | Carrier reassigns IP, modem reconnects |
| Datacenter rotating | Minutes to hours | Rarely ends early |
Providers advertise maximum lengths. On residential pools, real sessions often end before the maximum because the exit is someone’s phone or laptop. Good providers try to reconnect you to a new exit in the same location when that happens.
When to use sticky sessions
- Logging in and staying logged in for a task.
- Adding items to a cart and checking out.
- Paginating through search results where the site keeps state in a session cookie.
- Filling multi-page forms.
- Any site that challenges you once and then trusts a cookie tied to your IP.
Sticky sessions vs static proxies
| Sticky session | Static ISP proxy | |
|---|---|---|
| Same IP for | Minutes to hours | Days to months |
| Exit hardware | Shared pool device | Server |
| Can end early | Yes | No |
| Billing | Per GB | Per IP |
| Best for | Short stateful tasks at scale | Long-lived accounts |
Best practices
- Generate a new random session ID for each logical task, not for each request.
- Keep cookies together with the session they were created in; do not reuse cookies on a new IP.
- Detect IP changes (check the exit IP at the start and end of a task) and restart the task cleanly if the IP changed.
- Do not request longer sessions than you need. Shorter sessions are more stable on residential pools.
Session ID syntax examples
Providers implement sticky sessions in a few common ways. The exact parameter names differ, so check your provider’s documentation.
| Method | Example | Notes |
|---|---|---|
| Session ID in the username | user-session-a1b2c3:[email protected]:7777 | Change the ID to get a new IP |
| Session ID plus duration | user-session-a1b2c3-sesstime-30:pass@... | Duration in minutes, within the provider’s maximum |
| Dedicated sticky port | gate.example:10001 to gate.example:10999 | Each port maps to one sticky exit |
Use a random ID per task or per account, and store it alongside the task. If you reuse an ID after it expires, you will normally get a different IP.
Handling an IP change mid-session
A sticky session is held on a real device that can go offline at any time. Build for that:
- Check the exit IP at the start of each multi-step flow and keep it in your logs.
- If a step fails with a connection error, check whether the exit IP changed before you retry.
- If it did, restart the flow from the beginning with a new session ID rather than continuing with old cookies from a different IP.
- For flows that must not break, use a static or ISP proxy instead.
Sticky sessions and location filters
Combining a sticky session with a narrow target, such as a single city or ASN, shrinks the set of devices that can serve it. Sessions may be shorter and drop more often. If stability matters more than precise location, widen the filter to country level.
Frequently asked questions
What does sticky session mean for proxies?
It means your requests keep using the same exit IP for a set time instead of rotating, so websites see one consistent visitor.
How long can a sticky session last?
Commonly up to 10 or 30 minutes on residential networks, with some providers allowing several hours. The real duration depends on how long the exit device stays online.
Why did my sticky session change IP early?
The residential or mobile device behind it disconnected, or its IP changed. Providers cannot keep a session on a device that is offline.
Do sticky sessions cost more?
Usually not. On per-GB plans you pay for traffic, whether it rotates or sticks.
Should I use sticky sessions for social media accounts?
For short tasks they work, but accounts used daily are better served by a static ISP or static mobile proxy, so the IP stays the same between sessions.
Can two sticky sessions share the same IP?
Sometimes. In a shared pool, another customer or another of your own session IDs can land on the same exit device. Providers try to spread sessions out, but they rarely guarantee exclusivity.