Getting started

Rotating vs sticky sessions: how and when to use each

Rotating vs sticky sessions: how each mode picks your exit IP, why connection reuse matters, how to get both from the dashboard and which tasks need which.

3 min read Updated

On this page

Residential and mobile proxies give you many exit IPs through one gateway. The session mode decides how often your exit IP changes. Pick the wrong one and you either overload a single IP or get logged out halfway through a multi-step task.

Rotating sessions

With a rotating session, the gateway picks a new exit IP for each request. You use one proxy line, and the variety comes from the gateway, not from a list you manage.

Rotation suits work where each request stands on its own:

  • collecting public pages, such as product listings or search results
  • checking prices or ads across many pages
  • spreading a large number of independent requests over many IPs

What "per request" means for HTTPS

For an HTTPS website, your client opens an encrypted tunnel through the proxy and sends its requests inside it. The proxy can't see the individual requests inside the tunnel, so everything sent over one open connection leaves from the same IP.

Many HTTP clients keep connections open and reuse them, which is called keep-alive. That's good for speed, but it means a rotating line can look sticky:

import requests

PROXY = "http://USERNAME:PASSWORD@HOST:PORT"  # a rotating line from your dashboard
proxies = {"http": PROXY, "https": PROXY}

# Each requests.get() call opens a new connection,
# so each call can leave from a different IP.
for _ in range(3):
    print(requests.get("https://api.ipify.org", proxies=proxies, timeout=30).text)

# A Session reuses its connection, so these calls
# usually leave from the same IP.
with requests.Session() as session:
    for _ in range(3):
        print(session.get("https://api.ipify.org", proxies=proxies, timeout=30).text)

If you need a fresh IP for every request, open a new connection for each one. If you need a stable IP, don't rely on keep-alive to give you one; use a sticky session.

Sticky sessions

A sticky session keeps the same exit IP for a period of time, across many connections. You get one by using a sticky line from the generator. Each sticky line carries its own session, and every connection made with that line goes out through the same IP while the session lasts.

Sticky sessions suit work where the website expects one visitor to stay put:

  • logging in and then browsing as that account
  • multi-step flows, such as search, filter and paginate, or a checkout you are testing
  • any task where a sudden IP change would end the session or trigger a security check

A sticky session can end sooner than you expect. A residential or mobile IP belongs to a real device, and if that device goes offline, the session ends early. Build your code to notice failed connections, switch to a new sticky line and repeat the step that needs continuity.

Static IPs are a different product

Sticky sessions are not static IPs. Static residential proxies, ISP proxies and datacenter proxies give you a fixed IP for 30 days. There is no session to manage, and the IP stays the same until the period ends. If you need the same IP tomorrow and next week, for example for an account you manage every day, a static IP is the better choice.

Which mode to use

Task Mode
Many independent page requests Rotating
Search result or price checks across regions Rotating, with country targeting
Logging in and browsing as one account Sticky, or a static IP
A multi-step flow that keeps state on the server Sticky
One browser profile used over weeks Static IP
Requests that must come from a fixed, known IP Static IP

Getting both from the dashboard

You don't need to learn any username syntax. In the generator on your plan page:

  1. Choose rotating or sticky.
  2. Choose a country if you need one.
  3. Generate as many lines as you need. For sticky sessions, use one line per parallel task: one per account, browser profile or worker.

To keep an IP, keep using the same sticky line. To get a different IP, use a different sticky line.

Good habits

  • Give each account or browser profile its own sticky line, and never share one line between identities you want to keep separate.
  • Keep request rates reasonable on each IP. Rotation spreads the load, but it doesn't make an unreasonable request rate acceptable to a website.
  • Log the exit IP at important steps, so you can tell a session change from an error on the website.

The Python guide shows how to control connection reuse in requests, httpx and aiohttp.