What it means
An environment that isolates browser session state, including cookies and storage. Multiple pages can share one context, while separate contexts can isolate different tasks.
In tools like Playwright, browser instances, contexts, and pages are different hierarchies. Pages within a context can share state; creating independent contexts helps prevent sessions for one task from affecting another.
When it is necessary to retain the login status, the necessary status must be saved and restored according to the method provided by the tool. Context isolation does not automatically provide independent network exits, nor does it replace server-side account permissions.
Context isolation does not automatically preserve every sign-in state. Playwright’s authentication guide distinguishes reusable state from sessionStorage and provides no API to persist sessionStorage automatically. Fictional example: after importing storageState into a new context, a page relying on sessionStorage may still require sign-in. Check the actual storage mechanism; a saved file does not prove authentication succeeded. Focused check: 2026-11-24.
Browserbase Contexts are one specific persistence implementation: cookies, localStorage and IndexedDB can persist, but ordinary HTTP cache and sessionStorage do not. Hypothetically, after closing a session with persist: true, wait for synchronization before opening the next and check the login still works. This is not a persistence guarantee shared by all browser contexts. Focused check: 2026-11-29.
In a scraping task
Separate two collection tasks
The two tasks use independent contexts and maintain cookies respectively. After one task logs in, another task should not accidentally inherit the login status because it reuses the same context.
Common misconceptions
- Creating a new page does not necessarily mean creating a new isolated context.
- Context isolation is not proxy IP isolation, and the two need to be configured and verified separately.
References
Organized by Northleaf Studio. The source link retains the original address to facilitate continued reading.
- Playwright:Browser contexts
Original data · Verified on 2026-11-19
- Playwright: authentication state and sessionStorage
Primary sources · Checked 2026-11-24
- Browserbase · Contexts
Original sources · Checked 2026-11-29