# Session Control

Residential Proxies have two session modes: rotating (default) and sticky. You switch modes purely through username parameters — no dashboard settings involved.

## Rotating mode (default)

Without session parameters, **every connection request is assigned a new IP**:

```bash
curl -x proxy.eproxies.net:23333 -U "USERNAME-pool-flow-region-US:PASSWORD" https://ipinfo.io
# Run it twice in a row and you get two different IPs
```

Best for: data collection, price monitoring, ad verification — anywhere you want each request to come from a different IP.

## Sticky mode

Append `-sid-{8-char random}-ttl-{minutes}`; the same `sid` reuses the same IP for the duration of `ttl`:

```bash
curl -x proxy.eproxies.net:23333 -U "USERNAME-pool-flow-region-US-sid-a1b2c3d4-ttl-30:PASSWORD" https://ipinfo.io
# Repeat requests with the same sid within 30 minutes return the same IP
```

| Parameter | Description |
| --- | --- |
| `sid` | Session ID: 8 random alphanumeric characters, generated by you; each sid is an independent session |
| `ttl` | IP hold time in minutes, **1–120** |

Best for: account logins, multi-step forms, checkout flows — anything that needs session persistence.

## Session management tips

**Rotate on demand**: switch to a new `sid` to get a new IP immediately, without waiting for the ttl to expire.

**Parallel sessions**: different `sid`s are fully independent, so you can hold any number of fixed-IP sessions in parallel:

```python
import random, string, requests

def make_session_proxy(country: str) -> dict:
    sid = "".join(random.choices(string.ascii_lowercase + string.digits, k=8))
    url = (
        f"http://USERNAME-pool-flow-region-{country}-sid-{sid}-ttl-30:PASSWORD"
        "@proxy.eproxies.net:23333"
    )
    return {"http": url, "https": url}

# 10 independent sticky-IP sessions in the US
sessions = [make_session_proxy("US") for _ in range(10)]
for proxies in sessions:
    print(requests.get("https://ipinfo.io", proxies=proxies, timeout=30).json()["ip"])
```

> Residential IPs come from real devices, so a device going offline during a sticky session can cause an IP change. For reliability-critical flows, verify the exit IP at the application level.
