ResidentialIPs.org

Glossary Proxy features

Sticky session

By the ResidentialIPs Editorial TeamUpdated

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-7f3a91 is any string you choose. Reuse it to stay on the same IP; change it to get a new one.
  • sesstime-15 asks 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 typeTypical optionsWhat ends a session early
Residential1 to 30 minutes, some up to 24 hoursDevice goes offline, network changes
MobileMinutes to hoursCarrier reassigns IP, modem reconnects
Datacenter rotatingMinutes to hoursRarely 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 sessionStatic ISP proxy
Same IP forMinutes to hoursDays to months
Exit hardwareShared pool deviceServer
Can end earlyYesNo
BillingPer GBPer IP
Best forShort stateful tasks at scaleLong-lived accounts

Best practices

  1. Generate a new random session ID for each logical task, not for each request.
  2. Keep cookies together with the session they were created in; do not reuse cookies on a new IP.
  3. Detect IP changes (check the exit IP at the start and end of a task) and restart the task cleanly if the IP changed.
  4. 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.

MethodExampleNotes
Session ID in the usernameuser-session-a1b2c3:[email protected]:7777Change the ID to get a new IP
Session ID plus durationuser-session-a1b2c3-sesstime-30:pass@...Duration in minutes, within the provider’s maximum
Dedicated sticky portgate.example:10001 to gate.example:10999Each 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:

  1. Check the exit IP at the start of each multi-step flow and keep it in your logs.
  2. If a step fails with a connection error, check whether the exit IP changed before you retry.
  3. If it did, restart the flow from the beginning with a new session ID rather than continuing with old cookies from a different IP.
  4. 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.

Sources and further reading

Browse all 40 glossary terms Markdown version