Sessions
By default, every request rotates to a new IP. When you need the same IP across multiple requests, open a sticky session.
Per-request rotation
Section titled “Per-request rotation”Send requests with no sid flag. Each request uses a different IP.
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.9Sticky session
Section titled “Sticky session”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 lifetimecustomer-USERNAME-country-us-sid-order42-ttl-600 # custom 10-minute lifetimecurl -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)Choosing a session id
Section titled “Choosing a session id”- 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.
When the session expires
Section titled “When the session expires”- After
ttlseconds, 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.
Combining with geo-targeting
Section titled “Combining with geo-targeting”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 120scustomer-USERNAME-country-us-city-los_angeles-sid-scrape1-ttl-300 # custom 5-minAll requests with the same id stay on one Los Angeles IP for the duration of the TTL.
Sessions across machines and regions
Section titled “Sessions across machines and regions”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:443A single machine that always connects through p.shifter.io is usually not affected.
- Geo-targeting, narrow the pool before pinning.
- Integrations, session ids in Scrapy, Puppeteer, Playwright.