Rotating vs sticky residential proxies: which session type to use

New IP per request, or one IP for up to 120 minutes? When to use each session type and how to set it up.

By DINPROXY Team · · 5 min read

On this page

A residential proxy can give every request a new IP address, or it can hold one IP for a while. The first is a rotating session, the second a sticky session, and picking the right one shapes how a job runs. This guide explains both, when each fits, and how to choose them with DINPROXY.

What a rotating session does

With a rotating session, each request leaves through a different residential IP. To the target site, your traffic looks like many separate visitors rather than one busy client. That suits jobs made of many independent page loads.

Rotation is the default on DINPROXY residential proxies. If your username carries no session option, every request gets a new IP. Plain HTTP requests change IP even when your client reuses the same connection.

HTTPS and SOCKS5 work a little differently. An HTTPS tunnel or a SOCKS5 connection keeps its IP until it closes, so a client that reuses one such connection stays on one IP while it is open. To spread HTTPS requests across many IPs, give each request, or each worker, its own connection.

What a sticky session does

A sticky session keeps the same IP across many requests. You give the session an ID, and every connection that uses that ID goes out through the same address until the session ends.

On DINPROXY a sticky session lasts up to 120 minutes. You set the length yourself, from 1 to 120 minutes; if you leave it out, the session lasts 10 minutes. The IP can change earlier if it becomes unavailable or after 60 seconds without requests, so keep requests flowing while a flow is in progress.

When you want a new IP, use a new session ID. Session IDs belong to your proxy user, so they never clash with other customers' sessions.

When to rotate and when to stay sticky

The rule of thumb is simple: rotate when each request stands on its own, and stay sticky when requests depend on each other.

Use rotating sessions for:

  • Search result and listing pages, where each page is a separate fetch.
  • Price and stock checks across many product pages.
  • Large crawls where no request needs to remember the one before it.
  • Checking how the same page looks from many visitors or locations.

Use sticky sessions for:

  • Logins, so the whole signed-in visit comes from one address.
  • Carts and checkouts that run over several pages.
  • Multi-step forms and flows, such as filters that build on the previous page.
  • Paginated results that a site serves from a session it set up on the first page.

A single job can mix both. A price monitor might rotate through thousands of listing pages, then open a short sticky session for each product that needs a few linked requests, such as choosing a size before the price appears. For more on pairing rotation with realistic headers and pacing, read how to scrape a website without getting blocked.

How to choose a session type with DINPROXY

You choose the session type in the proxy username. Start with your connection username from Tools → Users: your account number, a ~, and the proxy user's name, such as 1024~myuser. Then add options to the end, each written as @name=value.

OptionExampleWhat it does
session@session=job42Keeps the same IP for every connection with this ID. Letters, digits and _, up to 64 characters
time@time=30With session: how long the sticky session lasts, 1 to 120 minutes (10 if left out)
country, state, city@country=usPicks the location of the IP. Works with both session types

A username without session gives you rotation. A username with session and time gives you a sticky session. This example keeps one US IP for 30 minutes and sends three requests through it:

import { fetch, ProxyAgent } from "undici";
const username = "USERNAME@country=us@session=job42@time=30";const token = Buffer.from(`${username}:PASSWORD`).toString("base64");const dispatcher = new ProxyAgent({  uri: "http://proxy.dinproxy.com:7777",  token: `Basic ${token}`,});
for (let i = 0; i < 3; i++) {  const response = await fetch("https://httpbin.org/ip", { dispatcher });  console.log(await response.text()); // same IP each time}

Replace USERNAME with your connection username and PASSWORD with the proxy user's password. Run the cURL command twice within the session and both replies show the same IP. Take out @session=job42@time=30 and each new connection gets a new IP. Use http:// for HTTP and HTTPS sites and socks5h:// for SOCKS5, both on proxy.dinproxy.com port 7777.

In the dashboard

To skip building usernames by hand, open Rotating Proxies → Connection setup. Under Session Type, choose Rotating Session for a new IP per request, or Sticky Session with the number of minutes to keep each IP, up to 120. Pick a location, set the quantity (up to 500 endpoints) and click Generate Preview.

Each generated endpoint gets its own session ID, so each sticky endpoint keeps its own IP. That makes it easy to give one endpoint to each worker, browser profile or account. The Location & sessions guide lists every option with more examples.

Tips for running sticky sessions well

A few habits keep sticky sessions predictable:

  • Match the length to the job. Set time to cover the longest flow you expect, up to 120 minutes. A quick login-and-check task needs far less than a long account session.
  • Keep the session busy. Send a request at least once a minute while a flow runs, since an idle session can move to a new IP after 60 seconds.
  • Use one ID per task. Give each account, cart or worker its own session ID, and create a fresh ID, such as a random string, when a task starts.
  • Start each task on a new IP. When one flow ends, begin the next with a new session ID rather than reusing the old one.
  • Add the location to the same username. Put country, state or city alongside the session options, as in 1024~myuser@country=gb@state=england@city=london@session=s1@time=20, to hold a local IP for the whole flow.

The same session and time options work on mobile proxies too, on port 7779 with country-level targeting. If you write your scrapers in Python, our guide to using a proxy with Python Requests walks through the proxy setup in code.

Frequently asked questions

Up to 120 minutes. Set the length with @time= (1 to 120 minutes); if you leave it out, a sticky session lasts 10 minutes.

Use a new session ID. Every connection with the same ID keeps the same IP, and a different ID gets a different IP.

Yes. Add country, state or city options to the same username, for example 1024~myuser@country=gb@state=england@city=london@session=s1@time=20.

Keep reading