Sticky sessions

Building sticky sessions connection

Kate avatar
Written by Kate
Updated over a week ago

The sticky session allows you to keep the same IP address with a specified session length to run multiple requests and be able to change them when needed.

SOAX offers proxy access through a single endpoint: proxy.soax.com:5000

Building sticky sessions connection:

Sticky sessions work with the parameters described below:

  • package_id - your package id can be found on the left top corner of your package card.

  • country – country code. Two symbols in ISO 3166-1 Alpha-2 format. You can generate it in the dashboard. To get a random country, simply exclude this parameter from the username string.
    Example: United Stites - us

  • city – city name. Adding this parameter to the authorization header will let you specify the city of the IP you want to use to process the request. Please use this parameter together with the country information. You can use the algorithm described on the screen above to choose a city.
    Example city: New York - new+york

  • region - region name. Adding this parameter to the authorization header will let you specify the region of the IP you want to use to process the request. Please use this parameter together with the country information. You can use the algorithm described on the screen above to choose a region.
    Example region: New York - new+york

  • isp - ISP name. Adding this parameter to the authorization header will let you specify the ISP of the IP you want to use to process the request. Please use this parameter together with the country information. You can use the algorithm described on the screen above to choose an ISP.
    Example ISP: at&t+u-verse

  • sessionid – a random string to create a session in order to keep the same proxy for more than one request. If this parameter is not indicated (along with sessionlength), you will get new IP on every request you make.
    Example: rand123456

  • sessionlength – must be used with session. Specifies the sticky session time in seconds – from 10 seconds up to 3600 sec (60 minutes). If you will not indicate, a session lasts for 180 sec.
    Example: 90

  • package_key - package key can be found in Login field of Quick Access block.
    Example: PFh4Nm42Boe6hcJ0

To build sticky sessions, you need to add the parameters described above:

  • Login:

    package-{your_package_id}-country-{cc_code}-sessionid-{session_id}-sessionlength-{time_in_sec}
  • Password (package_key)

    {package_key}
  • Server:

    proxy.soax.com
  • Port:

    5000

Use the Session ID only if you want a sticky session. Otherwise, just ignore that part to receive a rotating proxy with a specified Session length.


How sticky sessions work:

  1. To force an IP change, just modify the sessionid.

  2. Sticky sessions work only on 5000 port with endpoint proxy.soax.com.

  3. You can start as many parallel connections using sessions as you want. To do that, just use a different random string sessionid.

  4. If you keep sending requests to the same sessionid, you can maintain the same IP for any amount of time within the set sessionlength.

  5. If an assigned to the session node IP becomes unavailable, the proxy server will return the error “502 — Node is not available” and the new IP will be assigned in 60 seconds if the IP didn’t return.

  6. The session automatically expires in 60 seconds of inactivity. After that, a new IP will be assigned to this session’s ID. To keep this Session/IP for longer, send a tiny keep-alive request every 30 seconds to prevent this session from becoming idle for over a minute.

  7. While IP is assigned to a specified, sessionid it can not be assigned to another sessionid. Therefore, IPs in parallel active sessions cannot overlap.

  8. If you do not indicate sessionid and sessionlength you will get new IP on every request you make.

  9. For every new GEO-targeting, you need to use a different sessionid.

  10. sessionlength – must be used with session otherwise, you will get an error from the proxy server.

    When you are using Sticky Sessions, and you want to use any geo-targeting that includes more than one word in targeting, for instance, "New York" or "Los Angeles", instead of space or + can use %20 . Example:

    curl -k -x "http://package-130503-country-us-city-los%20angeles:[email protected]:5000" -L http://checker.soax.com/api/ipinfo

Examples of using Sticky sessions

Here is the basic example for the country US with a session length of 180 seconds with the request to our checker.

  • Windows:

curl -k -x http://package-<your_package_id>-country-us-sessionid-1-sessionlength-180:<your_package_login>@proxy.soax.com:5000 -L http://checker.soax.com/api/ipinfo
  • MacOS

curl -k -x "package-<your_package_id>-country-us-sessionid-1-sessionlength-180:<your_package_login>@proxy.soax.com:5000" -L http://checker.soax.com/api/ipinfo
  • Anti-detect browser

Please use your Login (package key) for Proxy password.
Also, you can use any other anti-detect browser.

Here is example of US country and 600 sec length.


1. In proxy (IP port) add - "server" from your dashboard and port 5000 (on the screenshot) - proxy.soax.com:5000
2. Proxy username - package-<your_package_id>-country-us-sessionid-rand3-sessionlength-600
3. Proxy password - your Login from the dashboard (on the screenshot)


Examples of the request string

Random proxy from a random target location with the new IP on each request

proxy.soax.com:5000 package-{your_package_id}:{your_package_login}

Random proxy from a specific country and random city/region/isp and new IP on each request

proxy.soax.com:5000 package-{your_package_id}-country-{cc_code}:{your_package_login}

A specific country and random city/region/isp with sticky proxy (using session ID) and default session length in 180 sec

proxy.soax.com:5000 package-{your_package_id}-country-{cc_code}-sessionid-{session_id}:{your_package_login}

A specific country, city, and random region/isp with sticky proxy (using session ID) and default session length in 180 sec

proxy.soax.com:5000 package-{your_package_id}-country-{cc_code}-city-{city_name}-sessionid-{session_id}:{your_package_login}

A specific country, city, and random region/isp with sticky proxy (using session ID) and custom session length

proxy.soax.com:5000 package-{your_package_id}-country-{cc_code}-city-{city_name}-sessionid-{session_id}-sessionlength-{time_in_sec}:{your_package_login}

A specific country, region, city, isp with sticky proxy (using session ID) and custom session length

proxy.soax.com:5000 package-{your_package_id}-country-{cc_code}-region-{region_name}-city-{city_name}-isp-{isp_carrier}-sessionid-{session_id}-sessionlength-{time_in_sec}:{your_package_login}

An example represents a list of credentials that establish different sessions in different countries with different sessions length (seconds).

proxy.soax.com:5000 package-64412-country-us-sessionid-rand123456-sessionlength-90:PFh4Nm42Boe6hcJ0 

proxy.soax.com:5000 package-64412-country-uk-sessionid-tsa122-sessionlength-180:PFh4Nm42Boe6hcJ0

proxy.soax.com:5000 package-64412-country-br-sessionid-rwaf123122-sessionlength-360:PFh4Nm42Boe6hcJ0
Did this answer your question?