Skip to content
sticky sessionsweb scrapingproxy configuration

Sticky Sessions for Web Scraping

A ProxyLabs sticky session holds one residential address for 10, 30, 60 or 120 minutes. The username order, and when that is too short.

A sticky session holds one residential address for a length you choose: 10, 30, 60, or 120 minutes. A rotating request can take a new address each time. Use sticky when the site ties the next request to the address that started the flow. Use rotating when each request stands on its own.

The choice is covered as a decision table in rotating vs sticky. This page is the session itself: the length, the username, and what happens when the clock runs out.

The lengths

MinutesSeconds in the username
10600
301800
603600
1207200

The dashboard writes those seconds as -ttl-, then a session id as -session-. The parameter order is country, then region, then city, then -ttl-, then -session-.

-ttl- is a lifetime, measured from the start of the session. Reusing the session id inside that window keeps the address. It does not start the clock again. A new session id is a new address. Copy the finished line from the dashboard when you need a city. The slugs are the ones that page offers.

Country codeGateway
us, ca, mx, br, ar, co, cl, peus.proxylabs.app:8080
Every other code, including gb, jp, and aueu.proxylabs.app:8080
bash
curl -x http://USERNAME-country-gb-ttl-3600-session-ab12cd:[email protected]:8080 https://example.com
bash
curl -x http://USERNAME-country-us-ttl-3600-session-ab12cd:[email protected]:8080 https://example.com

HTTP through this port is the setup to use. SOCKS5 is available on the same gateways when a tool asks for it.

A flow that has to share an address

Login, a cart, and a page that checks the cookie against the address that set it all need the same exit for every request in the flow. Put one session id on all of them, and pick a length that covers the whole flow.

python
import requests

proxy = "http://USERNAME-country-us-ttl-3600-session-ab12cd:[email protected]:8080"
proxies = {"http": proxy, "https": proxy}

with requests.Session() as client:
    client.post("https://example.com/login", data={"email": "[email protected]", "password": "pass"}, proxies=proxies, timeout=30)
    client.get("https://example.com/account", proxies=proxies, timeout=30)

Both requests leave from the address that ab12cd was given at the start of that 60-minute window. Generating the same id an hour later does not bring the first address back, and it does not add time to the first window.

When 120 minutes is too short

A sticky session ends. If the work needs the same address tomorrow, buy a dedicated ISP proxy. That address stays on the plan until you shuffle it, once every 30 days, and it is billed per IP per month. It does not use the residential gateway. The buying steps are in how to get a dedicated ISP proxy.

A queue or a checkout that you expect to last longer than the length you picked will still be going when the address changes. Pick 60 or 120 minutes at the start when the wait may run past half an hour. There is no call that extends a ttl that has already started.

Residential bandwidth lists at £2.50/GB, is £1.00/GB from 5,000 GB, and is £0.95/GB from 10,000 GB. Data does not expire. The connection map is in how to connect.

Useful guide? Share it with your team.

Share
← Back to all articlesBack to top ↑
All articles ↗
proxies

Rotating vs Sticky Proxies: When to Use Each

Sticky vs rotating proxies: a new address on each request, or the same address for 10, 30, 60, or 120 minutes. When to use each on ProxyLabs.

8 min read
residential proxies

Why your residential proxy still gets blocked on Akamai and Cloudflare sites

A residential exit can be clean and still meet a block page. The address, the TLS handshake, and the challenge script are three separate checks.

6 min read
residential proxies

How to Connect a ProxyLabs Residential Proxy

The residential gateways, username order, and sticky lengths ProxyLabs actually uses. Copy the finished string from your dashboard.

4 min read