---
title: "Rotating vs Sticky Proxies: Which Session to Use | Proxonym"
description: "Rotating vs sticky proxies explained: how each session type works, the exact username parameters, how to pick a session lifetime and pitfalls to avoid."
url: https://proxonym.com/blog/rotating-vs-sticky-sessions
updated: 2026-10-01T21:31:28+00:00
---

Fundamentals · October 1, 2026 · 5 min read

# Rotating vs Sticky Proxies: Choosing the Right Session Type

Rotating sessions change IP on every request; sticky sessions hold one IP for a set time. How each works, how to set the lifetime, and the mistakes that break both.

By the Proxonym team

Rotating proxies give you a new IP address on every request. Sticky proxies keep the same IP for a set time, so a multi-step flow such as a login, a search with several result pages, or a checkout comes from one address. Use rotating sessions for independent requests at scale, and sticky sessions whenever the target ties requests together with cookies or server-side state. On our [residential](https://proxonym.com/residential-proxies), mobile and unlimited gateways, you switch between the two with a single username parameter.

## How rotating sessions work

With no session parameter, the gateway picks a fresh peer for each request. Run this twice and you get two different IPs:

**Shell**

```bash
curl -x http://gw.proxonym.com:8000 -U "USERNAME-country-us:PASSWORD" https://api.ipify.org
```

Rotation has three benefits. Load spreads across the pool, so per-IP rate limits are rarely reached. A blocked IP costs you one request, not a whole job. And your requests look like many unrelated visitors, which is what they are. The cost is continuity: anything that depends on the same visitor coming back, such as a shopping cart, a login or a server-side search cursor, can break.

Rotation happens when a new connection goes through the gateway. For HTTPS, your client opens a CONNECT tunnel to the target, and every request sent through that tunnel uses the same exit IP. HTTP clients that keep connections alive can therefore reuse one IP for several requests. Open a new connection per request when you need strict rotation.

## How sticky sessions work

Add `-session-{id}` to the username and the gateway keeps the same IP for every request that carries that ID. The ID is any string of 1 to 32 letters and digits that you choose. Add `-lifetime-{minutes}` to set how long the IP is held; without it, a sticky session lasts 10 minutes.

**Shell**

```bash
# The same New York IP for up to 30 minutes
curl -x http://gw.proxonym.com:8000 \
  -U "USERNAME-country-us-city-new_york-session-a7k2-lifetime-30:PASSWORD" \
  https://api.ipify.org
```

Reuse the ID within its lifetime and you get the same IP; change the ID and you get a different one. To check, run this loop: it prints the same IP three times. Remove `-session-test1` and it prints three different IPs.

**Shell**

```bash
for i in 1 2 3; do
  curl -s -x http://gw.proxonym.com:8000 -U "USERNAME-session-test1:PASSWORD" https://api.ipify.org; echo
done
```

The maximum lifetime depends on the product:

| Product | Rotating behavior | Sticky lifetime |
| --- | --- | --- |
| Residential | New IP per request | 1 to 120 minutes |
| Unlimited residential | New IP per request | 1 to 720 minutes (12 hours) |
| Mobile | New IP per connection | 1 to 3 minutes |
| ISP | Static, no rotation | The same IP for your whole term |

Residential peers are real devices, so a peer can go offline before a session's lifetime ends. The gateway then returns `502`. Retry once; if the session keeps failing, start a new session ID and, for logged-in flows, sign in again.

## Choosing a session lifetime

Set the lifetime to the longest time one flow needs, plus a margin. Longer is not safer: an IP that gets flagged halfway through stays with you until the session ends, and a long session gives its peer more time to drop.

| Task | Suggested lifetime |
| --- | --- |
| Paginating one search or category (pages 1 to 5) | 2 to 5 minutes |
| Add to cart and checkout testing | 10 to 15 minutes |
| Log in, then read several account pages | 15 to 30 minutes |
| Long dashboard or reporting sessions | 60 to 120 minutes on residential, up to 12 hours on [unlimited residential](https://proxonym.com/unlimited-residential-proxies) |
| Mobile app flows | Up to 3 minutes; design for re-authentication |
| Accounts that must keep one IP for days | Not a session job: use static [ISP proxies](https://proxonym.com/isp-proxies) |

Check the request count per IP as well. A worker that sends one request every two seconds on a 30-minute session sends 900 requests from one IP. If the target starts challenging an IP after a few hundred requests, shorten the lifetime or slow the worker down. Lifetime and request rate together decide how hard each IP works.

## Examples: scraping vs login flows

### Scraping a product catalog: rotating

Product pages are independent. Each request can come from a different IP, and a block on one page does not affect the next. Leave out the session parameter, target the country whose prices you want, and let failed requests retry on a new IP.

### A logged-in flow: sticky

A login sets a cookie that many sites bind to the IP that created it. Seeing that cookie arrive from a different IP on the next request is a classic sign of session hijacking, and the site may log the user out or ask for verification. Keep the IP and the cookie jar together for the length of the flow:

**Python**

```python
import secrets
import requests

def sticky(country, minutes):
    sid = secrets.token_hex(6)   # 12 letters and digits
    url = (f"http://USERNAME-country-{country}-session-{sid}-lifetime-{minutes}"
           ":PASSWORD@gw.proxonym.com:8000")
    return {"http": url, "https": url}

proxies = sticky("gb", 20)
with requests.Session() as s:   # one cookie jar, one IP
    s.post("https://example.com/login", data={"email": "...", "password": "..."},
           proxies=proxies, timeout=30)
    orders = s.get("https://example.com/account/orders", proxies=proxies, timeout=30)
```

Only automate logins to accounts you own or are authorized to use. More patterns, including retries and timeouts, are in the [Python requests proxy guide](https://proxonym.com/blog/python-requests-proxies).

### Sticky per task, rotating across tasks

Most real jobs mix both. A rank tracker gives each keyword its own short sticky session, so pages 1 to 3 come from one visitor while different keywords use different IPs. A headless browser needs a sticky session for every identity, because a single page load pulls dozens of resources that should all come from one IP; see [Puppeteer and Playwright proxies](https://proxonym.com/blog/puppeteer-playwright-proxies).

### Rotating every N requests

Some targets tolerate a short burst from one visitor but not hundreds of requests. A middle ground is to keep each IP for a fixed number of requests, then switch:

**Python**

```python
import secrets

class SessionRotator:
    """Return the same session ID for per_ip requests, then a new one."""

    def __init__(self, per_ip=20):
        self.per_ip, self.used, self.sid = per_ip, 0, secrets.token_hex(4)

    def username(self, country):
        if self.used == self.per_ip:
            self.used, self.sid = 0, secrets.token_hex(4)
        self.used += 1
        return f"USERNAME-country-{country}-session-{self.sid}-lifetime-10"
```

Create one rotator per worker so that workers never share an IP, and tune `per_ip` to what the target tolerates.

## Pitfalls to avoid

- **One session ID for every worker.** If 50 threads share `-session-1`, they share one IP and hit rate limits together. Give each worker or task its own ID.
- **Predictable IDs across scripts.** Two jobs that both use `-session-1` end up on the same IP. Generate random IDs.
- **Changing parameters mid-flow.** Keep the whole username identical for the life of a session, including the country and city.
- **Kept-alive connections on rotating jobs.** Connection pooling can pin an IP, as described above. If rotation matters, close connections between requests.
- **Rotating IPs with persistent cookies.** Either clear cookies between requests or use a sticky session. A stable cookie on a changing IP is the worst of both.
- **Expecting long sessions from mobile.** Mobile sessions last up to 3 minutes. Use residential, unlimited or ISP proxies for longer flows.

The full parameter reference, including `-state-`, `-asn-` and `-type-mobile`, is in the [documentation](https://proxonym.com/docs).

## Key takeaways

- Rotating: no session parameter, a new IP per request. Use it for independent pages at scale.
- Sticky: `-session-{id}` plus `-lifetime-{minutes}`. Use it for logins, carts, pagination and browsers.
- Keep lifetimes as short as the flow allows: up to 120 minutes on residential, 12 hours on unlimited, 3 minutes on mobile.
- Use one random session ID per worker or task, and never share IDs across jobs.
- For an identity that must last days, use static ISP proxies instead of sessions.

Put it into practice

- [Residential proxies](https://proxonym.com/residential-proxies): Best for scraping well-protected sites. from **$0.74**/GB
- [Unlimited residential](https://proxonym.com/unlimited-residential-proxies): Best for heavy crawls and AI training data. from **$33.25**/day
- [Mobile proxies](https://proxonym.com/mobile-proxies): Best for social media and mobile apps. from **$0.74**/GB

Step-by-step setup

- [cURL proxy setup](https://proxonym.com/integrations/curl)
- [Puppeteer proxy setup](https://proxonym.com/integrations/puppeteer)
- [Multilogin proxy setup](https://proxonym.com/integrations/multilogin)

Try it on your own target

Self-serve plans, crypto accepted, live in minutes. Plans never renew on their own.

## Keep reading

[All articles](https://proxonym.com/blog)

- [What Is a Residential Proxy? How It Works and When to Use One](https://proxonym.com/blog/what-is-a-residential-proxy): How residential proxies route traffic through real home IPs, where those IPs come from, what they are good for, where they fall short, and how to choose a provider. (Fundamentals, 5 min read)
- [How to Choose a Residential Proxy Provider: 10 Checks](https://proxonym.com/blog/choose-residential-proxy-provider): Headline prices hide most of the cost. Ten checks that tell residential proxy providers apart, a table of red flags and a simple way to test on your own targets. (Guides, 5 min read)
- [Proxies for AI Agents: Reliable Web Access for LLM Apps](https://proxonym.com/blog/proxies-for-ai-agents): AI agents fail when the web blocks them. Which tool fits each job, from search grounding to browsing agents, with Playwright code and the rules that keep agents welcome. (Guides, 5 min read)
