Sticky Sessions and Geo: Handling Authenticated Scraping Flows
Authenticated flows break when the IP changes mid-session. A guide to sticky sessions, geo pinning and when a rotating proxy is the wrong choice.
Why Authenticated Flows Break
Many scraping jobs fail not because a request was blocked, but because a session was dropped. When a target binds state to your IP or session, changing the exit address mid-flow invalidates the state. That is where sticky sessions come in: they keep the same exit IP for the duration of a task so the target sees a stable client.
Without a sticky session, a rotating proxy can turn a working authenticated job into a series of 401s and redirects that look like blocks but are really session loss.
How Sticky Sessions Work
A sticky session appends a session identifier to the proxy username. The gateway holds that exit IP for a set period, often up to thirty minutes, instead of rotating on every request. Your client keeps the same address across the whole flow, which is exactly what a checkout, login or paginated sequence needs.
The duration matters. A session that is too short breaks a long flow; one that is too long can look unnatural. Choose the window based on how long a single user journey actually runs.
Geo Pinning with a Sticky Session
Geo and session work together. When you pin a country and hold a session, the exit IP stays within that geo for the whole task. This prevents the telltale sign of a session that starts in one country and jumps to another, which is a strong flag on most targets.
Set the geo at session creation and keep it fixed for the session's life. The geo-targeting guide covers how to configure it, and the rotation guide explains when rotating is actually the better choice.
When Rotating Is the Right Call
Sticky sessions are not always better. For open catalog crawling and APIs that do not bind state, rotating gives you more IPs and lower block risk. Using a sticky session for a high-cardinality, stateless crawl wastes IPs and can look more suspicious than rotating.
The decision rule is simple: if the job needs state across requests, go sticky; if every request is independent, rotate.
A Practical Setup
Set the session identifier, pin the geo, and pick a window that covers your full flow. Log the exit IP and session id on the first request so you can verify the session held. If you see the IP changing mid-task, the session is not sticking and the target is being handed a new client.
The docs walk through the gateway configuration. For a deeper look at how sessions and geo affect real workloads, the use cases page is a good starting point, and the proxy catalog shows which pool types support session persistence.
A Common Mistake
Teams often blame a rise in block rates on target hardening when the real cause is session loss. A quick test — run one request, then a second a minute later, and compare the exit IP — tells you whether the session is sticking. If it is not, fixing the session is cheaper than buying more bandwidth.
Handle authenticated flows with intent. A stable client, a pinned geo and a sensible window turn a fragile job into one that simply works.