Sticky sessions
The difference between rotating and sticky IPs, how -session- and -life- work, and when to use each.
Rotating vs. sticky
By default every new connection through the gateway can land on a different
exit IP — that's rotating mode, and it's what you get from a bare
credential or one with only geography options (-country-, -state-,
-city-, -asn-):
curl -x "http://ofp_0123abcd-country-us:PASSWORD@proxy.oneforproxy.com:8080" https://api.ipify.org
Sticky mode pins one exit IP to a session id for a set number of
minutes, so repeated requests look like they come from the same visitor.
Add -session-<id> (letters and digits, max 32 chars) and, optionally,
-life-<minutes> (1–1440):
# same IP for 10 minutes under session id "job42"
curl -x "http://ofp_0123abcd-country-us-session-job42-life-10:PASSWORD@proxy.oneforproxy.com:8080" https://api.ipify.org
curl -x "http://ofp_0123abcd-country-us-session-job42-life-10:PASSWORD@proxy.oneforproxy.com:8080" https://api.ipify.org # → same IP
The two calls above return the same address as long as both run inside the
10-minute window and use the exact same session id.
Running sessions in parallel
Each distinct session id gets its own IP, independent of every other id,
so parallel sticky sessions are just parallel ids:
curl -x "http://ofp_0123abcd-session-worker1-life-30:PASSWORD@proxy.oneforproxy.com:8080" https://api.ipify.org &
curl -x "http://ofp_0123abcd-session-worker2-life-30:PASSWORD@proxy.oneforproxy.com:8080" https://api.ipify.org &
curl -x "http://ofp_0123abcd-session-worker3-life-30:PASSWORD@proxy.oneforproxy.com:8080" https://api.ipify.org &
wait
worker1, worker2 and worker3 each hold a different IP for the
duration. This is the pattern to use for concurrent threads, browser
profiles or scraper workers that each need a stable-but-separate identity —
see Multi-profile browser tools for a worked
example.
Renewing or dropping a session
Reusing the same session id inside its life window keeps the same IP.
Once life expires, the next request with that id gets a new IP and
starts a fresh window. To force a new IP immediately, switch to a session
id you haven't used before, or drop -session- entirely for rotating mode.
When to use which
- Rotating — bulk scraping, sampling many exit IPs, or anything where a new identity per request is what you actually want.
- Sticky — logging into an account, a multi-step checkout or form flow, or anything that checks your IP stays consistent across requests within one session.
Sticky and rotating traffic cost the same per GB — see Pricing. For more on how per-GB billing works, see Per-GB billing, explained. For the full username syntax including geography keys, see Targeting and the Docs.