What is a sticky session?

A sticky session is a mode in which the proxy keeps the same IP address for a set time.

Updated · Prokso editorial team

Key takeaways
  • A sticky session holds one IP address for a few minutes or up to two hours, unlike rotation on every request.
  • It is needed for multi-step actions: logging in, a shopping cart, checkout.
  • In Prokso these are ports 10000-20000 (1 to 120 minutes, 30 by default) or a session number in the username on ports 823/824.
  • It is not a dedicated IP: after the session the address goes back to the shared pool, and it may change earlier if the device goes offline.

A sticky session is a proxy mode in which one IP address is kept for a set time. In the regular mode a rotating proxy changes the address on every request. A sticky session holds one address for several minutes or tens of minutes. In the Prokso generator this mode is called "Sticky session".

This is needed for actions made of several steps: logging in to an account, placing an order, filling in a form. If the address changes in the middle of the process, the website may ask for confirmation or drop the login. The address is not assigned to you forever: after the session ends it goes back to the shared pool, and next time you will get a different one. Below we cover why websites want a stable address, how to choose the session duration and how to work with several sessions at once.

You may also meet other names for the same mode: sticky IP, fixed session, session proxy, static session. Don't confuse it with a static proxy: there the address is yours for weeks or months, here only for the length of the session.

Why a website wants a stable address

When you log in, the website gives the browser a session cookie and remembers which address the login came from. After that it checks every request against this picture. If a minute later the same user shows up from another country or another network, it looks like a stolen session.

Reactions vary: logging in again, a code by email, a temporary restriction. For a real person, an address change once every few hours is normal - a phone switches from Wi-Fi to mobile internet. But a change on every click looks unnatural. A sticky session makes your work look like a normal scenario: one address for the whole action.

A simple example is an online store. You add an item to the cart from one address, go to checkout from another and confirm payment from a third. Some stores will empty the cart in this situation or ask you to log in again. With a sticky IP the whole path goes through one address.

A new IP for every request or a sticky IP for the session - it depends only on the portPort 823 / 824 - a new IP for every requestPort 10000-20000 - one IP for the whole session (1-120 min)request 1203.0.113.24request 1203.0.113.24request 2198.51.100.7request 2203.0.113.24request 3192.0.2.141request 3203.0.113.24request 4203.0.113.90request 4203.0.113.24request 5198.51.100.33request 5192.0.2.88session ends
A new IP for every request or a sticky IP for the session - it depends only on the port

How to choose the session duration

In Prokso you set the duration in the generator, in the "Session duration, minutes" field: from 1 to 120, 30 by default. Longer is not always more convenient. The longer a session lasts on residential and mobile addresses, the higher the chance that the device goes offline earlier.

TaskSuggested durationWhy
Checking a cart or a multi-step form5-15 minutesThe action is short, a long session is not needed
Working in one account30-60 minutesA typical session of a person on a website
A long process without breaksup to 120 minutesThe maximum; it is worth splitting the process into stages
Independent requests to a catalognot neededRotation on ports 823/824 is the cheaper choice here

These are guidelines, not rules. Start with the default value and change it if you see sessions breaking or, on the contrary, the address staying longer than the task needs. If a script regularly fails to finish within a session, don't jump straight to the maximum: often it is enough to remove extra steps and pauses or split the work into two parts.

Example lines and code

Each port from the 10000-20000 range keeps its own address. Two different ports mean two different sessions. You can check this with the prokso.com/ip page, which shows the address a website sees:

# session 1: the same address on every call while the session lasts
curl -x http://LOGIN__cr.de:PASSWORD@gw.prokso.com:10000 https://prokso.com/ip

# session 2: another port, another address
curl -x http://LOGIN__cr.de:PASSWORD@gw.prokso.com:10001 https://prokso.com/ip

# session number in the username on a rotating port: one address for about 30 minutes
curl -x "http://LOGIN__cr.de;sessid.shop1:PASSWORD@gw.prokso.com:823" https://prokso.com/ip

The ports work for both HTTP and SOCKS5: you choose the protocol in the generator. The full list of username parameters is in the help page on the gateway and connection string.

How many sessions you can keep at once

Each port is a separate session with its own address, and the 10000-20000 range has more than ten thousand ports. The limit is elsewhere: one plan allows up to 1000 concurrent connections. If you need more, create another plan - you can have as many plans as you like.

For several real accounts the rule is simple: each account lives in its own profile, on its own port and with its own IP, so that the accounts are not linked to each other. How to organize this is explained on the multi-accounting page and in the article "How many accounts you can run on one proxy".

Each of your accounts has its own profile, sticky port and IP, so the accounts are not linked to each otherAccount AProfile Aport 10000203.0.113.24Account BProfile Bport 10001198.51.100.7Account CProfile Cport 10002192.0.2.141
Each of your accounts has its own profile, sticky port and IP, so the accounts are not linked to each other

Sticky sessions and traffic

A sticky IP costs nothing extra: Prokso plans count only gigabytes in both directions, and the price per gigabyte is the same for both modes. While a session sits idle without requests, no traffic is used. The only thing counted differently is precise geo - region, city, ZIP or carrier: such traffic is counted double.

The remaining traffic is shown in your dashboard. There you can also set a limit per hour or per day so that a forgotten open session or a looping script does not use more than you planned.

Sticky sessions in an antidetect browser

In an antidetect browser each profile has its own proxy field. Enter the type HTTP or SOCKS5, the host gw.prokso.com, your own port from the 10000-20000 range, and the plan's username and password. The username sets the country, for example LOGIN__cr.de, so you don't enter it separately in the app.

After starting the profile, open the My IP page in it. It shows the address, country and time zone by IP. Set the profile's time zone and language to match the address country, otherwise the website will see a mismatch even if the address is stable. Step-by-step guides for popular apps are collected in the guides section.

A sticky session is not a dedicated IP

A sticky address is kept only for the length of the session. When it ends, the port gives out another address from the pool, and the previous one may go to another customer. You cannot get the same address tomorrow. Pay-per-GB plans take addresses from a shared pool, and an address just for you comes with static proxies.

For most tasks this is not a problem: the website cares that the address does not change in the middle of an action, not that it stays the same for a week. If the work stretches over several days, each new day is a new session, just like for an ordinary person who joined a different network in the morning.

What to do if a session breaks

A residential or mobile address belongs to a real device. If it goes offline, the port gets a new IP from the same country before the session ends. You cannot avoid this completely, but you can prepare your script:

  • before an important step, check the address with a request to prokso.com/ip and compare it with the previous one;
  • if the address has changed, finish the current step and start it again rather than continuing from the middle;
  • for long processes, use a shorter session and split the work into stages;
  • for a country with a small pool, don't narrow geo to a city without need: the narrower the choice, the fewer addresses match it.

This cause does not apply to datacenter addresses: they don't depend on anyone's devices. So for long sessions on websites that accept datacenter addresses, datacenter proxies can be more stable.

A detailed look at the causes is on the "Sticky IP changed early" page. Plans with both modes are on the residential and mobile proxies pages.

Two ways to hold an IP in Prokso

The first is a port in the 10000-20000 range. Each port holds its own IP, and you set the session duration from 1 to 120 minutes, 30 by default. The ports work for both HTTP and SOCKS5, so one line differs from another only by the port number.

The second is a session number in the username on ports 823 and 824, for example LOGIN__cr.de;sessid.shop1. While the number stays the same, the IP holds for about 30 minutes, and a new number gives a new address. This is handy when a program lets you change only the username, not the port.

Why a sticky IP can change early

Residential and mobile addresses belong to real devices. If a phone or router goes offline, the port gets a new IP in the same country without waiting for the session to end. To the website this looks like an ordinary network change on the visitor's side.

A sign of such a change is a sudden confirmation prompt in the middle of work. Check the address on the My IP page in the same profile: if it is different, the session has started over. Long tasks are better split into short stages so that an address change does not hit a critical step.

How not to mix sessions between profiles

A typical mistake is to put one port or one session number into several profiles of an antidetect browser. Then all of them exit from one IP at the same time. Give each profile its own port and write down the "profile to port" mapping so you do not get confused.

The second mistake is forgetting that the address is different after a break. If a profile has been idle longer than the session duration, the port gives out a new IP, and that is normal behavior, not a failure.

Further reading

FAQ

How long does a sticky session last?

From 1 to 120 minutes, as you choose; 30 by default. If the address goes offline earlier, the gateway will give you another one.

Can I get the same address tomorrow?

Not in pay-per-traffic plans: after the session the address returns to the shared pool.

How is a sticky session different from rotation?

Rotation gives a new address on every request, a sticky session keeps one address for a set time. The first is for independent requests, the second for multi-step actions.

How do I get several different sticky addresses at once?

Use different ports from the 10000-20000 range: each port keeps its own address. Or use different session numbers in the username on ports 823/824.

Where do I change the session duration?

In the generator in your dashboard, in the “Session duration, minutes” field. The value is from 1 to 120, 30 by default.

Does a sticky session work with SOCKS5?

Yes. Ports 10000-20000 work for both HTTP and SOCKS5 - you choose the protocol in the generator.

Residential $1.59, mobile $2.50, datacenter $0.65 per GB

Sign up in a minute, get access right after payment.

Create account

Install the Prokso app