Sessions let you control how long you hold onto the same residential IP. Two modes:
- Rotating — every request gets a fresh IP (default)
- Sticky — the same IP is held for a configurable TTL via a session token
Rotating (default)
If you don’t pass a session modifier, each request pulls a new IP:
curl -x "http://acme:PASSWORD@pr-us.proxies.fo:13337" https://api.ipify.org
curl -x "http://acme:PASSWORD@pr-us.proxies.fo:13337" https://api.ipify.org
# Each call returns a different IP.
Good for: search scraping, broad crawls, SERP collection — anywhere you want to spread load across many IPs.
Sticky sessions
Append -session-<id> to your username. The <id> is any string you choose — as long as you pass the same one, you get the same IP back for the duration of the TTL.
# All three requests exit through the same IP
curl -x "http://acme-session-mysession1:PASSWORD@pr-us.proxies.fo:13337" https://api.ipify.org
curl -x "http://acme-session-mysession1:PASSWORD@pr-us.proxies.fo:13337" https://httpbin.org/headers
curl -x "http://acme-session-mysession1:PASSWORD@pr-us.proxies.fo:13337" https://example.com
Session TTL
Control how long the session holds the same IP with -ttl-<minutes>:
Username: acme-session-abc123-ttl-15
Password: <your password>
The session holds for that many minutes from the first request. After the TTL expires, the next request using that session ID starts a new session with a fresh IP.
If the assigned IP drops off the network before the TTL expires, a new IP is assigned and the session continues seamlessly — you don’t need to retry from your end.
Combining with targeting
Session and TTL stack after country / state / city:
Username: acme-country-us-state-ny-city-ran-session-abc123-ttl-15
Password: <your password>
This pins a New York IP for 15 minutes.
Picking session IDs
Session IDs are arbitrary strings you control. Best practice:
- Use a UUID or random hex string per logical “user” your code simulates
- Avoid predictable IDs (e.g. sequential integers) if session isolation matters
- Reuse IDs only when you genuinely want the same IP
import uuid, requests
session_id = uuid.uuid4().hex
username = f"acme-country-us-state-ny-session-{session_id}-ttl-15"
proxy = f"http://{username}:PASSWORD@pr-us.proxies.fo:13337"
proxies = {"http": proxy, "https": proxy}
with requests.Session() as s:
s.proxies = proxies
s.get("https://example.com/login")
s.post("https://example.com/login", data={"user": "x", "pass": "y"})
s.get("https://example.com/dashboard")
When to use each mode
| Scenario | Mode |
|---|
| Scraping many pages across many sites | Rotating |
| Logging into an account and navigating | Sticky |
| Adding items to a cart and checking out | Sticky |
| Querying an API that rate-limits per IP | Rotating |
| Anything that checks session cookies against IP | Sticky |
Use the shortest TTL that covers your workflow. Shorter sessions recycle IPs faster and reduce the chance of a single flagged IP affecting many requests.