sessionsresidentialscraping

Rotating vs sticky sessions explained with examples

Rotating sessions give you a new IP for each request; sticky sessions hold one IP for a while. Here is how each works and when to use which.

5 min read

On this page

When you buy residential or mobile proxies, you get access to many IPs through a single gateway. The session mode decides how you move through them. A rotating session gives you a different IP for each request, and a sticky session keeps one IP for a while. Picking the right one is often the difference between a job that runs smoothly and one that keeps failing for reasons that look random.

The gateway model

With a residential or mobile plan, you don't get a list of IP addresses. You get one gateway address, and your proxy line tells the gateway what you want. The gateway then routes each connection out through a real device's connection, which becomes your exit IP.

This model gives you access to many IPs without managing a list at all. The trade-off is that the IPs belong to real devices that come and go, which matters for sticky sessions.

Session mode and country targeting are separate choices. From the same plan, you can have a rotating line for one country and a sticky line for another.

Rotating sessions

In a rotating session, the gateway picks a new exit IP for each request. One proxy line gives you a steady stream of different IPs.

Rotation is the natural fit when every request stands on its own:

  • collecting public product pages from an online catalog
  • checking search results for a long list of keywords
  • monitoring prices or ads across many pages
  • spreading a large crawl so that no single IP carries too much of the load

The benefit is spread. Sites limit how much traffic one visitor can send, and rotation divides your traffic across many visitors, so each IP sends only a small share of your requests.

Sticky sessions

A sticky session keeps the same exit IP across many requests and connections for a period of time. Each sticky line from your dashboard carries its own session, and everything sent with that line leaves from the same IP while the session lasts.

Stickiness is what you want when a website expects one visitor to stay put:

  • signing in, then browsing as that user
  • multi-step flows, such as filling in a form over several pages or testing a checkout
  • paginating through results when the site keeps state on the server
  • anything that would trigger a security check if the IP changed halfway

The detail most people miss: connection reuse

Here is something that surprises a lot of developers. On a rotating line, you may see the same IP several times in a row, even though the gateway rotates per request.

The reason is HTTPS. When you visit an HTTPS site through a proxy, your client opens an encrypted tunnel, and the proxy can't see the individual requests inside it. Most HTTP clients keep that tunnel open and send the next request through it, because that's faster. Every request in the same tunnel leaves from the same IP.

In Python's requests library, for example, requests.get() opens a new connection each time, so each call can get a new IP. A requests.Session() reuses its connection, so calls made through one session tend to keep the same IP. Browsers behave the same way: a tab loading one site usually reuses a few connections.

So:

  • If you need a new IP for every request on a rotating line, make sure each request opens a new connection.
  • If you need a stable IP, don't count on connection reuse to give you one. Use a sticky line, which holds the IP across connections.

Why sticky sessions end

A sticky session holds an IP for a while, not forever. Residential and mobile IPs belong to real devices on real networks. When a phone loses its signal or a home router restarts, that IP drops out and the session ends early.

This is normal, and the fix belongs in your code rather than in the proxy:

  1. Treat a failed connection on a sticky line as a possible end of the session, not as a fatal error.
  2. Switch to a fresh sticky line.
  3. Repeat the step that needs continuity, such as signing in again.

Log the exit IP at key steps. When something fails, you can then tell a session change from an error on the website.

Sticky sessions are not static IPs

A sticky session is a temporary hold on one IP from a shared pool. A static IP is a fixed address that stays yours for the plan's period. On FreshProxies, static residential proxies and ISP proxies keep the same IP for 30 days.

If you need the same IP tomorrow and next week, for example for an account you manage every day or a server that only accepts known IPs, a static IP is the right tool. Sticky sessions are for tasks measured in minutes, not weeks.

Choosing by task

What you're doing Use
Collecting many independent public pages Rotating
Checking search results or ads across countries Rotating, with country targeting
Signing in and working inside one account Sticky, or a static IP for long-term use
Multi-step forms or checkout tests Sticky
Paginating results that keep server-side state Sticky
One browser profile used daily for weeks Static IP

Many projects mix both. A price monitoring job might use rotating lines to collect product pages and sticky lines for the few flows that need a consistent visitor.

Practical tips

  • One identity, one sticky line. Give each account, browser profile or worker its own line, and never share a line between identities you want to keep apart.
  • Keep request rates human on sticky lines. A sticky IP that fires requests far faster than a person could stands out quickly.
  • Plan for concurrency. Ten parallel workers that each need a stable IP need ten sticky lines; ten workers that only need variety can share one rotating line.
  • Retry on a new connection on rotating lines. If a request fails, the next attempt on a new connection goes out through a different IP.
  • Don't edit session settings by hand. The generator in your dashboard builds ready-made rotating and sticky lines, including country options, so there's no username syntax to learn.

Setting it up

On FreshProxies, both modes come from the same plan. Open the generator, choose rotating or sticky, pick a country if you need one and generate as many lines as you have parallel tasks. The session guide in our docs has code examples, and the web scraping use case shows how rotation fits into a larger crawl. Residential proxies support both modes.

Keep reading.

All posts