Skip to content
Log In Sign up

Sessions

By default, every request rotates to a new IP. When you need the same IP across multiple requests, open a sticky session.

Send requests with no sid flag. Each request uses a different IP.

Terminal window
curl -x customer-USERNAME-country-us:PASSWORD@p.shifter.io:443 \
https://ipinfo.io/json
# 72.14.201.44
curl -x customer-USERNAME-country-us:PASSWORD@p.shifter.io:443 \
https://ipinfo.io/json
# 98.207.12.9

Add sid-<id> to the username. The id is any string you choose; subsequent requests with the same id return the same IP until the TTL expires or the IP drops upstream. ttl-<seconds> is optional and only valid alongside sid — it overrides the default lifetime (120 seconds, minimum 1). The panel’s endpoint builder also defaults to 120.

customer-USERNAME-country-us-sid-order42 # default 120s lifetime
customer-USERNAME-country-us-sid-order42-ttl-600 # custom 10-minute lifetime
Terminal window
curl -x customer-USERNAME-sid-order42-ttl-600:PASSWORD@p.shifter.io:443 \
https://ipinfo.io/json
# 72.14.201.44
curl -x customer-USERNAME-sid-order42-ttl-600:PASSWORD@p.shifter.io:443 \
https://ipinfo.io/json
# 72.14.201.44 (same)
  • Pick something unique per workflow (order-42, user-a7f3, checkout-2024-11-21-1).
  • Two separate runs sharing the same id at the same time will collide on one sticky IP.
  • The id is arbitrary; Shifter does not parse it. It is used as a cache key.
  • After ttl seconds, the mapping drops and the next request rotates to a new IP (targeting flags are preserved).
  • If the underlying residential IP disconnects sooner, the session ends early and the next request rotates.

Sticky sessions respect your other flags. A session id locks in one IP from within your filter:

customer-USERNAME-country-us-city-los_angeles-sid-scrape1 # default 120s
customer-USERNAME-country-us-city-los_angeles-sid-scrape1-ttl-300 # custom 5-min

All requests with the same id stay on one Los Angeles IP for the duration of the TTL.

Sticky sessions are kept per region. p.shifter.io connects each machine to its nearest region, so the same sid used from two machines that land in different regions gets two different IPs. This affects:

  • A scraper and a captcha solver that both use the session (the solver connects from its own servers).
  • Several servers, containers or cloud functions sharing one session.
  • A browser and a separate API client that must appear as the same visitor.

To keep one IP everywhere, point every tool that shares the session at the same regional entry point, for example fra.p.shifter.io:

customer-USERNAME-country-us-sid-order42-ttl-600:PASSWORD@fra.p.shifter.io:443

A single machine that always connects through p.shifter.io is usually not affected.