When you log in to a site and then appear to be coming from a different country on the second request, the platform notices immediately: same cookie, different IP. The result is usually a dropped session or a request for additional verification. Sticky sessioneliminates this problem by letting you keep the same exit IP for a defined period.
In this article we look at how a sticky session works, how to manage its duration, and how to handle drops.
The Problem: What Does an IP Change Break?
From the platform's point of view, this produces the same signal as a stolen cookie being used from another location. The defensive reflex kicks in.
How Do You Request a Sticky Session?
There are three ways to tell the gateway "send these requests through the same exit". The most common is to embed a session key in the username:
You generate the key yourself. As long as you send the same key, the gateway tries to route you to the same node; when you change the key, you get a new exit.
| Method | Example | Advantage |
|---|---|---|
| In the username | user-session-a1 | Single port, unlimited sessions |
| Per port | gateway:10001 | Fixed identity, practical with simple clients |
| Via API | POST /session/create | Programmatic management of the session lifecycle |
Key Generation: Practical Rules
Deriving the key from the account ID instead of generating it randomly and storing it lets you keep the same session even after the process restarts.
Regenerating the key randomly on every request. In that case the session parameter is visible but useless; every request gets a new exit. Verify in your code that the key really stays constant by logging it.
TTL: How Long Should You Choose?
Choosing a longer duration than necessary makes you send more requests from the same IP and increases the risk of rate limiting. Set the duration according to the real needs of the job.
For panel access that requires a persistent session and for long-running account management, using a static ISP proxy directly is more appropriate than sticky; that IP never changes.
Why Do Sticky Sessions Drop?
The first two rows stem from your own code, the third from the nature of the pool. To diagnose, first verify that the key is constant.
Handling Drops Gracefully
Sticky is not a guarantee; a node can drop off the network at any moment. The right approach is to design for a drop as an expected condition rather than treating it as an error:
Detect the IP change
Record the exit IP at the start of every session. If the IP has changed at a periodic check, treat the session as dropped.
Close the session cleanly
Keep the cookies, but do not abandon an operation midway; an unfinished operation raises suspicion on the platform.
Re-establish with a new key
Generate a new session key and log in again from scratch. Do not try to use the old cookie with the new IP.
Limit the number of retries
Many consecutive re-logins for the same account raise alarms on the platform. Put a wait between attempts.
Account–IP Mapping
If you manage multiple accounts, the most critical rule is this: every account must have its own session key and this mapping must be preserved over time. Multiple accounts appearing from the same IP is one of the strongest correlation signals platforms have.
Keep the mapping in persistent storage (a database or a file), not in memory; otherwise your accounts get spread across different exits on every restart.
For multi-account scenarios, our social media proxy article and our product page provide additional context.
Verification: Is Sticky Really Working?
Run this test before you buy, too. The gap between the promised duration and the actual behavior can be decisive when choosing a provider.
Summary
A sticky session is a prerequisite for any job that requires logging in. Derive the key from the account ID and store it persistently, choose the TTL according to the real needs of the job, and treat a drop as an expected condition rather than an error. If you need a permanent IP, instead of sticky static ISP proxy is the more appropriate tool. To verify your configuration, see My IP Address and proxy checker tools.