All posts

Residential IP browser sessions: Cost and setup

What are residential IP browser sessions? One browser that keeps a home IP, cookies and storage across a flow. Learn setup, cost and when datacenter is enough.

  • residential ip
  • browser sessions
  • sticky sessions
  • cookies
  • proxy cost
On this page

A residential IP browser session is one browser that exits through an ISP-assigned home IP and keeps it, with its cookies, storage, timezone and language, for the whole multi-step flow. On Wayfern, residential IP browser sessions pick their exit from country, region, city, isp and a sticky session id on the /ws URL. Try a datacenter exit first and use residential when a target pushes back, because no IP type guarantees access.

This guide to residential IP browser sessions is for developers whose login or checkout flow passes step one and fails by step four. The exit IP changed while the cookie jar stayed put, so a cookie issued to one address arrived from another.

After reading, you can pick a session type, request a validated location, keep cookies and storage consistent, estimate the cost, and decide whether you need a residential exit at all.

Key Takeaways

  • An unknown location code is refused with close code 4007; it never falls back to another place.
  • On Wayfern’s pricing, open-page time costs 8 credits per hour, residential bandwidth 320 credits per GB: break-even is 25 MB per hour.
  • Wayfern has no customer-facing persistent profiles, so you save and restore cookies and storage in your own code.
  • Own-proxy traffic isn’t metered as residential bandwidth.

What are residential IP browser sessions?

Residential IP browser sessions come in three types: sticky sessions keep one IP across steps, rotating sessions change IP per connection or request, and static sessions use a fixed IP long term.

Every ISP-assigned address sits inside an autonomous system (AS). RFC 1930 defines an AS as “a connected group of one or more IP prefixes run by one or more network operators which has a SINGLE and CLEARLY DEFINED routing policy.” A site can look up that owner and tell a home ISP from a hosting company.

Mobile exits work differently. RFC 6598 sets aside a shared address block for carrier-grade NAT (CGN) devices, so many phones can reach a site through one public address.

The three types of residential IP browser sessions differ in how they hold an IP and what ends them:

  • Sticky: one IP is held across a multi-step flow. A session id on the connection URL identifies it, and closing the socket ends it.
  • Rotating: each connection or request gets a new IP. No id exists, and nothing carries over between requests.
  • Static: one fixed IP is assigned to you long term. The address itself identifies it, and it ends when you release it.

Wayfern’s tool for holding an IP is the sticky session id. In the URL from Wayfern’s developer docs, wss://api.wayfern.com/ws?token=LINK_TOKEN&country=US®ion=CA&session=run42, the id run42 holds one residential IP for the flow, and opening the socket starts the session. No create-session REST call exists.

Our page on anti-detect browser sessions lists every exit parameter. A pooled instance is reused only for the same link token, workload and exit, and it’s torn down when the last connection closes.

Why must the exit IP, cookies and fingerprint match for a whole session?

The exit IP, cookie jar and fingerprint must match for a whole session because a site reads them together, and a change in one shows up against the others.

In residential IP browser sessions, the signals sit in two places:

  • Server-side: the exit IP and its ASN (the network that owns the address, such as a home ISP or a hosting company), plus every cookie, which the browser sends with each request.
  • Client-side: local storage and its keys, the timezone from Intl.DateTimeFormat().resolvedOptions().timeZone, the language from navigator.language and the Accept-Language header, WebRTC candidate addresses, the user agent and User-Agent Client Hints.

MDN’s resolvedOptions() reference says resolvedOptions() returns “the locale and date and time formatting options computed during initialization” of the formatter. The value reflects the browser’s settings, so a US exit with a Berlin timezone shows up in one call.

RFC 8828 covers how WebRTC implementations handle IP addresses, which is why a candidate address can disagree with the exit.

The same Wayfern page notes that a cookie issued to one IP and replayed from another is an easy signal for a site to read, so a mid-flow exit change is the mismatch to avoid.

The user agent needs care in residential IP browser sessions. Chrome’s user-agent reduction docs describe it as “minimizing the identifying information shared in the User-Agent string”, with full version detail moved to Client Hints. A hand-set string with a specific full version is therefore an unreliable way to line a browser up with a proxy location.

Wayfern applies the browser identity inside its own Chromium build, driven over the Chrome DevTools Protocol.

How do you request a residential location for a browser session?

You request a residential location by adding country, region, city, isp and session to the WebSocket URL, and Wayfern checks every code against a live catalog before it hands over the browser. No proxy URL appears in your script.

  1. Read the link token from the environment. Export WF_TOKEN, read it with process.env.WF_TOKEN, and keep the token out of source.

  2. Build the URL from parameters. country takes an ISO-3166 code, region and city narrow it, isp picks the provider, and session holds one residential IP across a flow. Connect, then take the default context with browser.contexts()[0].

import { chromium } from "playwright";

const params = new URLSearchParams({
  token: process.env.WF_TOKEN,
  country: "US",
  region: "CA",
  session: "run42",
});

const browser = await chromium.connectOverCDP(
  `wss://api.wayfern.com/ws?${params}`,
  { timeout: 120_000 },
);
const page = await browser.contexts()[0].newPage();
await page.goto("https://example.com/login");
  1. Set a long connect timeout. The script sets timeout: 120_000 to leave margin.

  2. Handle a refusal. An accepted socket sends a JSON connected message with a connectionId first, then plain CDP. A refused location closes the socket with code 4007. In the catch block around connectOverCDP(), open the same URL on a raw ws socket and read the close code:

import WebSocket from "ws";

function diagnose(url) {
  const ws = new WebSocket(url);
  ws.on("close", async (code) => {
    if (code !== 4007) return;
    // Set WF_LOCATIONS_URL to the catalog path exactly as written in /docs/api
    const res = await fetch(process.env.WF_LOCATIONS_URL);
    console.log("Valid codes:", await res.json());
  });
}

Wayfern’s anti-detect browser sessions page states the rule: “Every code is checked against the live catalog before the browser is handed over; an unknown location is refused with close code 4007 instead of falling back to the wrong place.”

Sending country=US with region=ZZ, a code that isn’t a US region, closes the socket with 4007. Your handler prints the catalog, you pick a valid region, and you reconnect. No browser opens in a different state, so no page loads from the wrong place.

For your own proxy, pass proxy=own per connection. To run this script, get a link token from the docs quickstart.

How do you save and restore cookies between residential IP browser sessions?

You save and restore cookies between residential sessions in your own code, because Wayfern keeps no cookie state between runs. Wayfern’s comparison with Multilogin says it plainly: “Wayfern has no customer-facing persistent profiles at all. No named profiles, no cookie import or export, no per-vector fingerprint switches.”

  1. Connect with the same location. Use the country and region values you used when you saved. On a connected browser, Playwright’s BrowserType docs say the default context is available through browser.contexts().
  2. Restore before you navigate. Call context.addCookies() from Playwright’s BrowserContext API, then write local storage with an init script so it exists before the page’s own scripts run.
  3. Save before you close. Read context.cookies() and local storage through page.evaluate, then write both to your own store.
const ORIGIN = "https://example.com";
const browser = await chromium.connectOverCDP(
  "wss://api.wayfern.com/ws?token=LINK_TOKEN&country=US&region=CA&session=run42",
);
const context = browser.contexts()[0];
const page = context.pages()[0] ?? (await context.newPage());

const saved = JSON.parse(await fs.readFile("state.json", "utf8"));
await context.addCookies(saved.cookies);
await page.addInitScript(([origin, ls]) => {
  if (location.origin === origin)
    for (const [k, v] of Object.entries(ls)) localStorage.setItem(k, v);
}, [ORIGIN, saved.local]);
await page.goto(ORIGIN + "/account");

// ...work...

const cookies = await context.cookies();
const local = await page.evaluate(() => ({ ...localStorage }));
await fs.writeFile("state.json", JSON.stringify({ cookies, local }));
await browser.close();

Landing on /account without a login prompt means the restore worked. Key each saved file by country and region, and restore it only under that same location.

For logged-in flows from start to finish, see our guide to authenticated scraping.

How much do residential IP browser sessions cost: bandwidth or open-page time?

Residential browser sessions cost both: Wayfern’s pricing page lists browser time at 8 credits per open-page hour and residential bandwidth at 320 credits per GB, with datacenter egress free, so a residential session runs two meters at once. One formula covers every session:

total credits = (open-page seconds / 3,600 x 8) + (residential GB x 320)

The same page says time is metered per second with a 60-second minimum per page.

Cost driverUnitWhere it applies
Open-page time8 credits per hourEvery exit
Residential bandwidth320 credits per GBBuilt-in residential exit
Datacenter egressFreeDefault exit
Own-proxy trafficNot metered as residential bandwidthSaved http, https or socks5 proxy

The break-even is 8 / 320 = 0.025 GB. A page open for one hour that moves more than 25 MB through a residential exit spends more on bandwidth than on time.

If you hold one page open for 10 minutes (600 seconds) and move 0.15 GB through a residential exit, time costs 600 / 3,600 x 8 = about 1.33 credits. Bandwidth costs 0.15 x 320 = 48 credits. The total is about 49.33 credits, and bandwidth is roughly 97% of it.

Each billing model for residential IP browser sessions hides something. Bandwidth metering rewards light pages and punishes media-heavy ones. Open-time metering rewards fast flows and punishes long idle waits.

Billing by page hides both counters. That suits single fetches and fits poorly when you hold a login across several steps.

Your own proxy is the main lever on the bandwidth line. Wayfern’s API reference says you can save an http, https or socks5 proxy on a link (proxyMode: "own") and choose it per connection with proxy=own, proxy=residential or proxy=none.

Traffic through your own proxy is not metered as residential bandwidth, so you pay only the 8-credit time rate and whatever your proxy provider charges. Credentials stay out of the URL, and the stored password is encrypted at rest. You do take on the proxy’s quality, location and terms yourself.

Each exit fits a different target:

  • Datacenter exit: targets that accept it, since you pay only for time.
  • Built-in residential exit: targets that push back, when you want city or ISP targeting and a sticky session id without running proxy accounts.
  • Own proxy: heavy pages or long flows where you already hold a proxy contract and want to keep bandwidth off the 320-credit meter.

When do you not need a residential IP for browser sessions?

You don’t need a residential IP for browser sessions when the target accepts a datacenter exit, so start there and move up only when a target pushes back.

  1. Start on the default datacenter exit. Connect to wss://api.wayfern.com/ws with your link token and no location parameters. You pay only open-page time on this exit (see the current rates on /pricing). If the page loads and your selectors match, stop here.
  2. Use the Web Data API for page-level jobs. Send proxy: "auto" to the scrape endpoint. The API reference says it starts on a datacenter exit and retries on residential when blocked. You can also force datacenter or residential and set a country. Each response returns the exact credits charged, and failed Web Data work isn’t billed.
  3. Switch to a residential exit for logged-in, multi-step flows. Add country and a sticky session id (for example session=run42) to the browser link URL. Skip this step for public pages that step 1 or 2 already fetch, or you pay for bandwidth you didn’t need.

Many targets accept datacenter traffic. For residential IP browser sessions, the exit adds cold-start time as well as a bandwidth charge.

Some targets do refuse datacenter traffic, because a site can map an address range to the hosting network that owns it. Remote Browser’s guide says cloud servers “egress through data center IP ranges. These ranges are heavily flagged by anti-bot systems.”

Our buyer’s guide to web scraping tools compares page-level APIs with held browser sessions.

Does a residential IP guarantee access to a site?

A residential IP does not guarantee access to a site, because detection is an arms race and the exit address is only one input. EvoProxy’s guide says “Platforms score the connection, the session pattern, and the device context together,” and adds that “IP reputation still matters, but it is only one signal.”

Even in residential IP browser sessions, a cookie jar, timezone or fingerprint that disagrees with the exit can still draw a challenge.

Use residential exits for public-data collection, testing, monitoring and research, inside the target’s terms and the law. Ask any residential provider whether device owners knowingly consented to share their connection, and whether it can show that consent.

A residential exit on Wayfern comes with these trade-offs:

  • Cold starts: slower than on a datacenter exit, so keep the long connect timeout.
  • Bandwidth: Wayfern’s pricing meters residential traffic per GB, separately from open-page time.
  • Viewports: you set width and height only.
  • Fingerprint control: customers get no per-vector switches.
  • State: there are no persistent profiles, so cookies and storage live in your own code.

Those last two limits decide the purchase. When a person manages many long-lived identities by hand, a desktop profile manager such as Multilogin is the right buy, and our Wayfern vs Multilogin comparison covers the split. Wayfern is the programmable kind, where your code drives the browser over CDP.

Frequently asked questions

Sticky or rotating residential IP for a login flow?

Use sticky for any flow where a site sets a cookie and checks it on the next request, such as login, checkout or form steps. A sticky session id keeps one residential IP for the flow, so the cookie and the IP stay paired. Use rotating only for independent single-page fetches.

Do I need a residential IP for every scrape?

No. Start on the datacenter exit and move to residential only for targets that push back. For page-level jobs, the Web Data API’s proxy: "auto" starts on a datacenter exit and retries on residential when blocked.

What if I request a city that doesn’t exist?

Wayfern refuses the connection with close code 4007. It checks every code against a live catalog and never falls back to another place, so a typo in city fails loudly instead of exiting somewhere you didn’t choose.

Does a residential IP stop a site from blocking me?

No. According to EvoProxy’s guide, platforms score the connection, the session pattern and the device context together. IP reputation is only one signal. Treat access as likely on some targets, never guaranteed.

Can I use my own proxy instead?

Yes. Save an http, https or socks5 proxy on your link, then pick it per connection with proxy=own|residential|none. Credentials never go in the URL, and own-proxy traffic isn’t metered as residential bandwidth.

Next steps for residential IP browser sessions

Today: Pick one target flow, such as a login plus one form, and run it on the default datacenter exit. If the target accepts it, you need no residential exit.

This week: If the target pushes back, add country, region and a sticky session id to the /ws URL. Then add your own cookie and storage save-and-restore, so the cookie jar travels with the location that issued it.

This month: Model the cost with the open-page-hour plus bandwidth formula. Price the same flow through your own proxy and compare the two totals.

Mint a link token for your project and open your first residential IP browser session with the quickstart in the Wayfern developer docs. Start from a credit pack or the Developer plan on the pricing page, and test one flow before you commit to anything larger.

Sources

Residential Proxy: What It Is and How to Use It · Wayfern API reference · Anti-Detect Browser Sessions over CDP | Wayfern · Pricing | Wayfern · Wayfern vs Multilogin: anti-detect browser comparison · RFC 1930: Guidelines for creation, selection, and… · RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space · Residential IP Proxy: The Definitive 2026 Guide. Every other source is linked where the article cites it.

See us more often in Google

One click marks Wayfern as a preferred source in Google, so our posts can show up more often in your Top Stories, AI Mode and AI Overviews.