Use one browser context for every tab that must share a login. In Playwright, create multiple Page objects from the same BrowserContext. In Puppeteer, create multiple pages from the same browser context. Cookies and related browser storage are scoped to that context, so the pages see the same session. Separate contexts are intentionally isolated.
The browser context is the sharing boundary
A headless Chrome “tab” is represented by a page, while the cookie jar belongs to the browser context that contains the page. Pages created in one context share cookies, cache, and origin storage. Pages created in different contexts do not.
- Same context: tabs can reuse the same login session.
- Different contexts: identities remain isolated, even inside one browser process.
window.open(): a child window remains in its parent page’s context and therefore uses the same context storage.
This arrangement is usually safer than manually copying individual cookies. Log in once, then create the other pages from that context.
Share cookies between Playwright pages
The following complete example logs in through one page and opens two authenticated pages from the same context. Replace the selectors and login URL with those used by your application.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
import { chromium } from 'playwright';
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext();
const login = await context.newPage();
await login.goto('https://example.com/login', { waitUntil: 'domcontentloaded' });
await login.fill('[name="email"]', process.env.TEST_EMAIL);
await login.fill('[name="password"]', process.env.TEST_PASSWORD);
await login.click('button[type="submit"]');
await login.waitForURL('**/account');
const tabA = await context.newPage();
const tabB = await context.newPage();
await Promise.all([
tabA.goto('https://example.com/account', { waitUntil: 'domcontentloaded' }),
tabB.goto('https://example.com/orders', { waitUntil: 'domcontentloaded' })
]);
console.log('Account title:', await tabA.title());
console.log('Orders title:', await tabB.title());
await context.close();
await browser.close();
context.newPage() creates both pages in the same cookie jar. If the login flow sets cookies after a redirect, wait for the post-login URL or another authenticated condition before opening the dependent pages.
Seed a context with known cookies
For a test that already has a session cookie, add it to the context before creating pages. The cookie must have the correct name, value, domain, and path.
const context = await browser.newContext();
await context.addCookies([
{
name: 'session',
value: process.env.SESSION_COOKIE,
domain: 'example.com',
path: '/',
secure: true,
httpOnly: true,
sameSite: 'Lax'
}
]);
const page = await context.newPage();
await page.goto('https://example.com/account');
A leading dot in a domain, such as .example.com, can make a cookie apply to subdomains. Preserve the cookie’s secure, httpOnly, sameSite, and expiry properties when those attributes matter to the application.
Share cookies between Puppeteer pages
Puppeteer uses the same model: create one browser context, then create every related page from it.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ headless: true });
const context = await browser.createBrowserContext();
const login = await context.newPage();
await login.goto('https://example.com/login', { waitUntil: 'domcontentloaded' });
await login.type('[name="email"]', process.env.TEST_EMAIL);
await login.type('[name="password"]', process.env.TEST_PASSWORD);
await Promise.all([
login.waitForNavigation({ waitUntil: 'domcontentloaded' }),
login.click('button[type="submit"]')
]);
const tabA = await context.newPage();
const tabB = await context.newPage();
await Promise.all([
tabA.goto('https://example.com/account', { waitUntil: 'domcontentloaded' }),
tabB.goto('https://example.com/orders', { waitUntil: 'domcontentloaded' })
]);
console.log(await tabA.title());
console.log(await tabB.title());
await browser.close();
Do not create the pages with separate incognito contexts when they need the same login. Puppeteer documents browser contexts as isolated storage containers, so separate contexts intentionally do not share cookies or local storage.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Move an authenticated session to another context
Use this pattern when workers need independent contexts but should start from one authenticated login. Playwright’s storageState export includes cookies and can include other origin data depending on the options and Playwright version.
import { chromium } from 'playwright';
const browser = await chromium.launch({ headless: true });
const source = await browser.newContext();
const login = await source.newPage();
await login.goto('https://example.com/login');
// Complete the login flow here.
await login.waitForURL('**/account');
await source.storageState({ path: 'state.json' });
const worker = await browser.newContext({ storageState: 'state.json' });
const page = await worker.newPage();
await page.goto('https://example.com/account');
await worker.close();
await source.close();
await browser.close();
For in-memory transfer, obtain the state object and pass it to a new context instead of writing a file:
const state = await source.storageState();
const worker = await browser.newContext({ storageState: state });
A direct cookie-only transfer is also possible:
const cookies = await source.cookies();
await worker.addCookies(cookies);
Filter cookies before adding them if the destination should not receive every identity or domain. Never print live session-cookie values, commit them to source control, or place them in shared build logs. Treat state.json as a credential.
Free tools Windows power users keep installed
One-click scans. No signup required.
Choose the right sharing method
| Method | Isolation | Survives restart | Non-cookie state | Parallel testing | Main risk |
|---|---|---|---|---|---|
| Pages in one context | Lowest between those pages | No, unless you save state | Shared context storage | Simple, but pages can affect one another | Accidental identity or state mixing |
Imported storageState |
Separate after creation | Yes, when saved | Cookies plus supported origin data | Good for independent workers | State file becomes a credential |
| Direct cookie injection | Separate context, selected cookies only | Only if you save and reload them | Cookies only | Good when the application uses cookie authentication | Missing local storage, IndexedDB, or required attributes |
| Persistent profile | Profile-wide | Yes | Cookies and profile storage | Less convenient for many isolated workers | Two browser instances must not use the same profile directory |
Use a persistent profile when state must survive launches
Playwright’s persistent context stores browser data, including cookies and local storage, in a user-data directory:
import { chromium } from 'playwright';
const context = await chromium.launchPersistentContext('./profiles/test-user', {
headless: true
});
const page = await context.newPage();
await page.goto('https://example.com/account');
await context.close();
Only one browser instance should use a given user-data directory at a time. Use a different directory for each identity or concurrent worker.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Cookies are not always the complete login
A page can appear logged out even when the expected cookie is present. Authentication may also depend on local storage, IndexedDB, passkeys, or server-side checks. Playwright’s built-in storage-state workflow does not persist sessionStorage; if an application requires it, capture and restore it with an initialization script for the relevant origin.
Copying a cookie also does not guarantee server acceptance. Token rotation, expiry, device binding, IP checks, and other application rules can invalidate a session in a new worker or environment. Keep the browser context and network conditions consistent when diagnosing such failures.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Cookie scope details that commonly break sharing
- Domain: a cookie for
app.example.comis not automatically sent toapi.example.com. A properly scoped parent-domain cookie may cover subdomains. - Path: a cookie restricted to
/accountwill not be sent for unrelated paths. - Secure: secure cookies require HTTPS requests.
- HttpOnly: page JavaScript cannot read these cookies, but the browser can still send them with requests.
- SameSite: cross-site navigation and embedded requests may be restricted by this attribute.
- Expiry: an expired cookie can remain in copied data but will not authenticate a request.
Troubleshooting
The second page is logged out
Check that both pages were created from the same context, not from two calls to browser.newContext() or two Puppeteer browser contexts. Create the second page only after login has completed, then inspect the page URL and authenticated response rather than relying only on a visible username.
The cookie exists but is not sent
Compare the request’s host and path with the cookie’s domain and path. Verify HTTPS for a secure cookie, check expiry, and account for SameSite restrictions. When injecting a cookie, supply the required domain or URL and preserve its attributes.
storageState did not restore the login
Confirm that the state file was written after the final login redirect and that the new context targets the same origins. If the application stores tokens in IndexedDB or uses a passkey, cookie-only restoration is insufficient. If it relies on session storage, add explicit save-and-restore code.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Parallel tests interfere with one another
Give each identity its own context and, for persistent sessions, its own user-data directory. Do not reuse a writable state file while another worker is changing it. Close pages and contexts in teardown so locks and stale sessions do not leak into the next test.
The copied session is rejected by the server
Assume the session is application-bound until proven otherwise. Reauthenticate in the destination context and compare user agent, IP, token age, and device signals. A cookie value alone is not a portability guarantee.
Performance, reliability, and security practices
- Reuse one context for related tabs instead of logging in repeatedly.
- Use separate contexts for parallel identities, tenant isolation, and tests that must not affect one another.
- Wait for a reliable post-login condition before launching dependent work.
- Keep state files outside repositories and restrict their filesystem permissions.
- Delete or rotate saved sessions when a test run ends or a credential is revoked.
- Close contexts cleanly; persistent profiles can remain locked if a process is terminated abruptly.
- Prefer short-lived test accounts and least-privilege permissions for automation.
Or skip the browser setup
If your actual goal is to capture authenticated pages rather than coordinate multiple Chrome tabs, ScreenshotNeo provides a single screenshot request. Its API supports custom cookies and headers, while the service removes cookie-consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the page verdict and billing status.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options, including cookies, custom headers, waiting rules, and output formats. ScreenshotNeo also has an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo if a one-call capture fits your workflow.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsFrequently asked questions
Does opening a new tab automatically share cookies?
Only when the new tab belongs to the same browser context. A page opened with window.open stays in its parent context; a page created in a separate context does not share its session.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Should I copy cookies or export full storage state?
Export full storage state when the application may use local storage or IndexedDB. Copy cookies directly only when you have verified that cookie authentication is sufficient and you want tighter control over which cookies cross the boundary.
Can two contexts use the same saved state?
Yes. Load the same exported state into separate contexts to give workers an identical starting point, but treat the file as sensitive and expect the server to rotate or revoke sessions independently.
Why is a persistent profile unsuitable for every parallel worker?
A profile carries durable identity and browser data, and a user-data directory must not be opened by multiple browser instances simultaneously. Separate contexts or separate profile directories provide safer parallel isolation.
Frequently Asked Questions
Can I share cookies between tabs opened by different browser processes?
Not directly. Export authenticated state from one process and import it into the other, or authenticate separately; a live in-memory cookie jar belongs to its original browser context.
Will sharing a context synchronize page navigation?
No. Pages share storage, not navigation history or DOM state. Each page still has its own URL, document, JavaScript heap, and network activity.
Is a session cookie enough to bypass multi-factor authentication?
Not necessarily. The server may require additional device, token, passkey, or risk signals, and copying a cookie does not override those checks.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools

