Sticky session proxies
A sticky session keeps the same residential IP across many requests and connections, so a multi-step flow looks like one visitor from start to finish. On hyperproxy you start one by adding a session id to the username.
Updated 9 November 2026
What a sticky session is
By default, a rotating residential proxy gives every new connection a new exit IP. That is ideal for independent requests, but many real tasks are not independent. A login sets a cookie that the site ties to an IP. A cart and checkout span several pages. A headless browser opens dozens of connections to render one page. If the IP changes halfway through, the site sees a session jump between households, and the flow often fails.
A sticky session solves this by pinning one exit to a label you choose. Every connection that carries the label goes out through the same residential IP until the session expires.
How sticky sessions work on hyperproxy
Add session with an id of your choice, letters and digits only:
curl -x http://USER-cc-de-session-a81f:PASS@gw.hyperproxy.io:8888 https://api.ipify.orgRun it several times and the IP stays the same. Change the id and you get a different IP.
| Option | What it does | Example |
|---|---|---|
session | Pins all connections with this id to one exit | USER-session-a81f |
ttl | Session length in minutes. Default 5, maximum 120 | USER-session-a81f-ttl-60 |
speed | 1–10: try that many exits when the session starts and keep the fastest | USER-session-a81f-speed-5 |
cc, city, … | Targeting still applies to the pinned exit | USER-cc-jp-city-tokyo-session-k7x2 |
A few rules from the sessions docs:
- Send the same options with the session id for its whole life. Do not change the targeting halfway through a session.
- The session lasts for its
ttl. After that, the same IP is no longer guaranteed, so plan your flow to finish inside it. - If the exit goes offline, the session continues on a new IP rather than failing. Residential devices do disconnect, so design flows to tolerate a rare IP change.
- Without a session, retries get a new exit. Inside a session, they reuse the pinned one.
Examples
import uuid
import requests
session = uuid.uuid4().hex[:8] # letters and digits only
proxy = f"http://USER-cc-us-session-{session}-ttl-30:PASS@gw.hyperproxy.io:8888"
with requests.Session() as s:
s.proxies = {"http": proxy, "https": proxy}
for _ in range(3):
print(s.get("https://api.ipify.org", timeout=30).text) # same IP each timeGenerating a random id per task is the simplest pattern: one id per worker, browser context or user journey. Store it next to the job if you need to resume within the ttl. More detail is in the Playwright guide, the Puppeteer guide and the Python requests guide.
When to use sticky sessions
- Headless browsers. One page load means many connections for HTML, scripts, images and API calls. A session per browser context keeps them on one IP. This is the recommended set-up for Playwright and Puppeteer.
- Logged-in testing of your own accounts and services. QA teams checking a staging or production flow from a given country keep one IP for the whole run.
- Checkout and localisation QA. Walking a cart through checkout to verify regional prices, taxes and payment options as a local customer sees them.
- Paginated or stateful public pages. Some sites issue a cursor or token tied to the visitor; keeping the IP stable keeps the sequence consistent.
- Ad verification journeys. Following a click from an ad through redirects to the landing page, as one user in one location.
For high-volume independent fetches, rotation is simpler and spreads load more evenly. You can mix both in one job: a rotating login for listing pages and a sticky session for each detail flow.
Choosing a ttl
Pick the shortest ttl that covers the flow, plus a margin. Five minutes, the default, covers most page renders and short multi-step flows. Long QA scripts or monitoring runs that must stay on one IP can go up to 120 minutes. Longer sessions depend more heavily on one home connection staying online, so the chance of a mid-session failover grows with the ttl. If you need a new IP sooner, do not wait for expiry: start a new session id.
Speed: pick a fast exit up front
Residential exits differ in latency. With speed, the gateway tries several exits when the session starts and keeps the fastest. Higher values take a little longer to set up but help long sessions that move a lot of data:
curl -x http://USER-cc-us-session-k7x2-ttl-30-speed-5:PASS@gw.hyperproxy.io:8888 https://api.ipify.orgBe a good guest on one IP
A sticky session concentrates all your requests on one household connection and on one visitor profile at the target. Keep the request rate to what a person on that connection would plausibly generate, honour Retry-After on 429 responses, and stop rather than retry when a site says no with a 403. Handling 403 and 429 errors and web scraping best practices go into more detail. Billing is by bytes in both directions, the same as rotating traffic, with no per-session charge.
FAQ
How long can a sticky session last?
Up to 120 minutes. Set ttl in minutes; without it, a session lasts 5 minutes.
What happens if the residential device disconnects?
The session continues on a new exit that matches the same targeting. Your requests keep working, but the IP changes once.
How do I get a new IP before the session ends?
Use a new session id. Ids cost nothing to create; you only pay for the bytes you send and receive.
Can I combine sticky sessions with city targeting?
Yes. For example USER-cc-us-city-chicago-session-k7x2-ttl-30. Add strict-false to fall back to a wider area if no exit matches the city. See Targeting.
Does a sticky session work with SOCKS5?
Yes. The options are in the username, so they work the same for HTTP, HTTPS CONNECT and SOCKS5. See SOCKS5 residential proxies.
Is a sticky session the same as a static or ISP proxy?
No. A static or ISP proxy gives you a dedicated IP for days or months. A sticky session borrows a residential exit for up to two hours. The differences are explained in residential vs datacenter vs ISP vs mobile proxies.
Try it on your own workload
Sign up with GitHub or Google, create a proxy login and send your first request in a minute.
More residential proxy types
- Rotating residential proxies — How rotation works per connection, when to rotate, and how to control it.
- SOCKS5 residential proxies — SOCKS5 vs HTTP proxies, socks5h, and when SOCKS5 is the right choice.