No KYC — no ID, no selfie, no documents · City, state and ZIP targeting on every plan
Language: English
Get started

Guide · sessions

Residential proxy sticky sessions by US city

Rotating IPs suit wide samples; a sticky session suits anything that spans several pages, such as a cart, a store picker or a multi-step form on your own site.

Last updated: · 3 min read

Quick answer

How do I keep the same city IP across several requests?

Add a session ID and a time to live to the city username: USERNAME-country-us-state-mo-city-st_louis-session-stl1-ttl-20 asks MetroProxies to keep one St. Louis IP for up to 20 minutes. Sessions last up to 30 minutes, set per session with the ttl parameter; the IP can change earlier. Included on plans from $0.50/GB (October 2026). No KYC; crypto.

How do sticky sessions work?

Segmentssession-{id} and ttl-{minutes}, after the city or ZIP
Maximumup to 30 minutes, set per session with the ttl parameter; the IP can change earlier
Session IDLetters and digits you choose; a new ID gives a new IP
Rotating modeEach new connection gets an IP from the pool, usually a different one; to get a new IP on every request, send one request per connection (turn off keep-alive)
CostIncluded; billed by traffic only

When do I need a sticky session?

When the steps of one check must come from the same address.

  • Multi-page flows on your own site: add to cart, choose a store, see the shipping estimate. A change of IP in the middle can reset the location the site picked.
  • Before-and-after comparisons: load a page, change one setting, load it again from the same IP.
  • Pages that set location on the first visit: some sites store the detected city in a cookie; keep the IP so the cookie and the IP agree.

For wide samples (100 cities, one page each), rotating mode is simpler: each new connection gets a new IP in the requested city.

How should I name sessions when I run many cities?

Use one session ID per city and per run, so that results never share an IP by accident and a retry gets a fresh one.

  • -city-boise-session-boi20261018a-ttl-15
  • -city-spokane-session-spo20261018a-ttl-15
  • On retry after a failure: change the suffix (...b) to get a new IP.

Short, readable IDs make logs easy to read: the city code, the date and a letter are enough. Do not reuse the same ID across different cities.

What happens when the IP changes before the TTL?

It can happen: up to 30 minutes, set per session with the ttl parameter; the IP can change earlier. A residential IP belongs to a home device; if that device goes offline or its provider renews the address, the session cannot keep it.

Handle it in code:

  1. Record the exit IP at the start of the session (one lookup request).
  2. If a later step fails with a connection error, check the exit IP again.
  3. If it changed, start the flow again with a new session ID rather than mixing two IPs in one result.

Keep the TTL as short as the flow needs. A 5-minute flow does not need a 30-minute session, and shorter sessions are less exposed to device changes.

Python: one sticky session per city, restarted if the IP changes
import requests

GATEWAY = "gw.metroproxies.com:7777"


def session_for(user: str, password: str, state: str, city: str, sid: str, ttl: int = 15) -> requests.Session:
    name = f"{user}-country-us-state-{state}-city-{city}-session-{sid}-ttl-{ttl}"
    proxy = f"http://{name}:{password}@{GATEWAY}"
    s = requests.Session()
    s.proxies = {"http": proxy, "https": proxy}
    return s


def exit_ip(s: requests.Session) -> str:
    return s.get("https://api.ipify.org", timeout=30).text.strip()


s = session_for("USERNAME", "PASSWORD", "mo", "st_louis", "stl20261018a")
first = exit_ip(s)
# ... your multi-step check on your own site goes here ...
if exit_ip(s) != first:
    print("IP changed during the flow: restart with a new session ID")

Where should I go next?

Check the exit with the proxy location checker, use sessions for local price checks and ad checks by city, and see every segment in the username format. More on the guides page.

What else do people ask about sticky sessions?

Can I keep a city IP for a whole day?

No. up to 30 minutes, set per session with the ttl parameter; the IP can change earlier. For day-long work, keep the city constant and accept that the IP changes; record the IP with each result.

Does a sticky session cost more?

No. You pay for traffic only, whether the session is rotating or sticky.

How many sessions can I run at once?

Each session ID is independent, and you can run many in parallel from one account. Keep the request rate to each target modest and follow its terms; see the acceptable use policy.

1 GB $1.50 · no KYC

Get started