A sticky session is a proxy session that keeps the same exit IP address across many requests for a set time, usually by putting a session ID in the proxy username or by using a dedicated sticky port. It is the opposite of per-request rotation, and it is what multi-step flows like logins and checkouts need.
A rotating residential gateway normally hands each request a fresh IP from a large pool. For a sticky session you send a session ID, and the gateway maps that ID to one exit IP and keeps routing it there. Decodo's documentation describes this as a sticky port: once the first connection is made, the IP stays the same for the chosen duration regardless of how many requests follow, with presets of 1, 10, 30 or 60 minutes and custom durations up to 24 hours. Changing the session ID or port is how you force a new IP early.
Stickiness is a best effort, not a guarantee. Residential exit IPs are real consumer devices, and Decodo warns that the longer the session, the more likely the IP rotates before the timer ends because that device went offline. Providers also differ on limits: IPRoyal's lifetime parameter is reported to run from one second to seven days, while Plain Proxies caps it at 24 hours. Treat the configured duration as a ceiling.
Use a sticky session when server-side state is tied to the client's IP: a login followed by account pages, a cart and checkout, a paginated search whose cursor is bound to the session, or a challenge solved once and reused. Some anti-bot systems check this directly. AWS WAF Bot Control at the Targeted level records the category of IP that acquired a token and labels a request when the token is presented from a different category, such as acquired on a datacenter or proxy IP and presented from a residential one. A flow that changes IPs between the challenge and the follow-up requests is exactly what that check catches.
The cost is concentration. Every request in the session comes from one address, so per-IP rate limits and reputation scoring apply to it fully. The usual practice is one session ID per logical job, the shortest duration that covers the flow, and a check that the exit IP did not change mid-flow, restarting the job on a new session ID if it did. For plain list-page or API scraping that carries no state, per-request rotation spreads load better.
import uuid
import requests
# Username syntax for session IDs varies by provider; check yours.
def proxy_for(session_id: str) -> dict:
url = f"http://user-session-{session_id}:PASSWORD@gateway.example.com:7000"
return {"http": url, "https": url}
session_id = uuid.uuid4().hex[:10]
proxies = proxy_for(session_id)
s = requests.Session()
first_ip = s.get("https://api.ipify.org", proxies=proxies, timeout=30).text
# ... log in, add to cart, paginate: all through the same session ID ...
if s.get("https://api.ipify.org", proxies=proxies, timeout=30).text != first_ip:
# The residential peer dropped; restart the whole job on a new session ID.
raise RuntimeError("sticky IP rotated mid-flow")How Crawlora handles this
Crawlora's proxy layer handles session stickiness internally: requests that belong to one flow stay on a consistent exit, and stateless requests are distributed across the pool, so you don't manage session IDs, durations or early-rotation checks yourself.
Glossary
FAQ
A rotating proxy gives each request a new exit IP, while a sticky session keeps one IP for a set duration. Rotation suits high-volume, stateless collection and stickiness suits logins and multi-step flows.
It depends on the provider and the setting you choose, from presets of a few minutes up to a day or more. Residential sessions can still end early if the device behind the IP goes offline, so the configured time is a maximum.
Change the session ID (or the port, on providers that use sticky ports). The gateway then assigns a different exit IP.
Beyond Sticky Session (Sticky Proxy), Crawlora's own docs cover the rest of the stack — browse the APIs, test a request in Playground, and move from scraping infrastructure work to production data workflows.