Create a sticky session
Build a configuration and attach a session ID. Reuse the resulting object for related requests.- Python
- Rust
- Go
held to your HTTP client using the same helper as in the quickstart. If you create a new session object, update the client’s proxy configuration too. An existing client will not automatically switch to a new SDK object.
Request a session lifetime
Add attl parameter before creating the session. These alternatives replace the earlier initialization and request ten minutes:
- Python
- Rust
- Go
1m, 10m, 10h, and 24h as accepted examples. The product’s sticky-session limit is up to 24 hours, subject to the exit remaining available. Setting a lifetime does not guarantee that the original IP will remain online for that period.
See How sticky sessions work for product behavior and duration settings.
Keep the parameters consistent
A session identity depends on more than its ID. In particular, changing the location, proxy pool, or filter can select a different identity even if you reuse the samesid.
Build the configuration once for a workflow and reuse it. To change it deliberately, create a new object:
- Python
- Rust
- Go
held, update a running browser, or transfer application cookies to another session.
Generate session IDs for workers
Usesessions to generate configurations with separate random session IDs:
- Python
- Rust
- Go
- or whitespace. For example, use worker01, not worker-01. The generated IDs avoid these characters.
Use a configuration without a sticky session
Removesid and any sticky-session lifetime when you no longer want to request a pinned identity:
- Python
- Rust
- Go
sid does not request a sticky session. When testing rotation, consider your client’s persistent connections: two application requests can reuse an existing tunnel. Verify the exit with actual requests rather than assuming that each SDK object or client request creates a new connection.
Understand when an IP can change
Sticky sessions are different from the No rotating mode and from ISP proxies, which are a separate product.