# Test multiple sessions in the same browser

> Tabs in one browser share cookies, so one session. To test several at once, give each its own cookie store: incognito, a Chrome profile or a context.

Source: https://mosaicbrowser.com/guides/test-multiple-sessions-in-the-same-browser

## How to test multiple sessions in the same browser

Tabs and windows of one browser profile share cookies, so they share one signed-in session. To test multiple sessions in the same browser, give each session its own cookie store: a normal window plus an incognito one for two, separate Chrome profiles for more, or a Playwright browser context per user in tests.

![1 jar: Every tab in one profile shares one cookie jar, beside a screenshot: importing a cookie jar into a Mosaic profile](https://mosaicbrowser.com/covers/test-multiple-sessions-in-the-same-browser.webp)

A browser profile has one cookie jar, and every tab and window in it reads from that jar. If your app keeps its session in a cookie, which most do, then two tabs are one session: sign in as user B in the second tab and the first tab is user B too on its next request. To test multiple sessions in the same browser, the sessions need separate cookie stores, and there are four common ways to get them.

## What is shared and what is not

Before picking a method, know which storage your app uses for the session:

| Storage | Shared between tabs of one profile? |
| --- | --- |
| Cookies | Yes |
| `localStorage` and IndexedDB | Yes, per origin |
| `sessionStorage` | No, one per tab |
| In-memory state (a JavaScript variable) | No, one per page |

`sessionStorage` is the exception, and it has a catch. MDN says each tab gets its own page session, but "opening a page in a new tab or window creates a new session with the value of the top-level browsing context" ([Window.sessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage), read 2 November 2026). A tab opened from your app starts with a copy of the opener's values. An app that keeps a tab-scoped login in `sessionStorage` behaves differently depending on whether the tester pastes the address or middle-clicks a link, which is worth a test case of its own.

## Test two sessions in the same browser: a normal window and an incognito one

The quickest split is your normal window for user A and an incognito window for user B. Incognito starts with an empty cookie jar, so B signs in without touching A.

It stops at two. Google's help page says that when you open another incognito window, "your Incognito session continues in the new window", and the session ends only when you close all incognito windows ([Browse in Incognito mode](https://support.google.com/chrome/answer/95464?hl=en), read 2 November 2026). Every incognito window shares one jar. And when you close them, user B's session is gone, so the next run starts with a sign-in again.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Cookie jars](https://mosaicbrowser.com/features/cookie-jars)

## Three or more: one Chrome profile per session

Chrome profiles each have their own cookies, history and saved passwords. Google describes them as a way to keep "your different accounts, like work and personal, separate" ([Manage Chrome with multiple profiles](https://support.google.com/chrome/answer/2364824?hl=en), read 2 November 2026). Make a profile per test user, name it after the role, and each opens in its own window that stays signed in between runs.

This is enough for most manual testing of your own app. Its limits show when the app has defences: every Chrome profile on the machine reports the same hardware, the same timezone and the same IP address, so anything that scores sessions by device or network sees one person. [Do Chrome profiles share cookies](https://mosaicbrowser.com/guides/do-chrome-profiles-share-cookies) lays out exactly what they keep apart and what they do not. Firefox's containers do a similar split inside one window, with the same shared-device caveat; [containers vs an anti-detect browser](https://mosaicbrowser.com/guides/firefox-containers-vs-anti-detect-browser) compares them.

## In automated tests: a browser context per user

Playwright's answer is the browser context. Its documentation calls contexts "equivalent to incognito-like profiles" that are "completely isolated, even when running in a single browser" ([Isolation](https://playwright.dev/docs/browser-contexts), read 2 November 2026). Two users in one test look like this:

```
const adminContext = await browser.newContext()
const userContext = await browser.newContext()
const adminPage = await adminContext.newPage()
const userPage = await userContext.newPage()

```

Each context has its own cookies, `localStorage` and `sessionStorage`. This is the right tool for a chat test, a permissions test, or anything where one user's action has to appear on another user's screen.

## Sessions that also need their own device and network

Some sessions have to look like different people as well as hold different cookies: a fraud rule that flags two buyers on one device, a rate limit per IP, a support tool that shows the customer's location. For those, Mosaic gives each session a full profile: its own cookie jar and storage, its own proxy IP, and a fingerprint drawn from one real machine.

1. Click **New profile** once per test user and name each after its role, such as "Buyer - DE" or "Admin".
2. Under **Connection**, give the profiles different proxies if the test depends on the network, or **No proxy** if it does not.
3. Start them. Each opens in its own window and stays signed in across restarts.
4. Select the running profiles and use **Open URL** to load the same page in all of them, or **Type in all** to send the same keystrokes to each.
5. To reuse a session state, export the profile's cookies from its **Cookies** tab, and load them into a fresh profile for the next run. An import reaches a browser that is already running without a restart ([cookie jars](https://mosaicbrowser.com/features/cookie-jars)).

![Importing a cookie jar into a Mosaic profile](https://mosaicbrowser.com/shots/cookies.png)
*A saved session, loaded into a fresh profile*

![Six Mosaic profile windows arranged in a grid, each with its own name in the title bar](https://mosaicbrowser.com/shots/windows-arranged.png)
*One session per window, side by side*

On Pro, starting a profile over the local REST API returns its DevTools endpoint, so a Playwright test can attach to each session with `connectOverCDP`; [Playwright with an anti-detect browser](https://mosaicbrowser.com/guides/use-playwright-with-an-anti-detect-browser) has the code. Pro is $25 a month or $250 a year, and Free covers 3 profiles with no card, as [pricing](https://mosaicbrowser.com/pricing) sets out.

## Sources

1. [Google Chrome Help: Browse in Incognito mode](https://support.google.com/chrome/answer/95464?hl=en), read November 2, 2026
2. [MDN: Window.sessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage), read November 2, 2026
3. [Playwright docs: Isolation (browser contexts)](https://playwright.dev/docs/browser-contexts), read November 2, 2026
4. [Google Chrome Help: Manage Chrome with multiple profiles](https://support.google.com/chrome/answer/2364824?hl=en), read November 2, 2026

## Questions

### Do two incognito windows have separate sessions?

No. Google's Chrome help says an incognito session continues in a new incognito window and ends only when you close all of them, so every incognito window shares one cookie store. One normal window plus incognito gives you two sessions, not more.

### Is sessionStorage separate per tab?

Yes. MDN says each tab gets its own page session. A tab opened from another one starts with a copy of the opener's sessionStorage, though, so a test that opens a link in a new tab can carry state you did not expect.

### How do I test two users in one automated test?

In Playwright, create two browser contexts in the same test, one per user, each with its own saved sign-in state. Playwright's documentation shows an admin and a user side by side this way.

### Why does logging in as user B log out user A in my app?

Because both tabs send the same session cookie. Logging in as B replaces the cookie that A's tab was using, so on the next request A's tab is B. That is the browser behaving correctly, not your app breaking.

## Related

[How to test your app with multiple user accounts](https://mosaicbrowser.com/guides/test-your-app-with-multiple-user-accounts): Test your app with multiple user accounts: one seeded account per role, a separate browser session for each, and saved sign-in state so tests skip the login.

[Do Chrome profiles share cookies?](https://mosaicbrowser.com/guides/do-chrome-profiles-share-cookies): Do Chrome profiles share cookies? No: each profile has its own cookie file, storage and sign-ins. What they share is the computer, its fingerprint and its IP.

[Firefox containers vs anti-detect browser: what each separates](https://mosaicbrowser.com/guides/firefox-containers-vs-anti-detect-browser): Firefox containers vs anti-detect browser: containers split cookies per tab in one Firefox. An anti-detect browser splits cookies, fingerprint and IP.

[Cookie jars: import and export cookies per browser profile](https://mosaicbrowser.com/features/cookie-jars): Import and export cookies per browser profile in Mosaic: paste Cookie-Editor JSON, a Netscape cookies.txt or a Cookie header, and export the jar as JSON.

[How to use Playwright with an anti-detect browser](https://mosaicbrowser.com/guides/use-playwright-with-an-anti-detect-browser): Use Playwright with an anti-detect browser by starting the profile first and attaching with connectOverCDP. Keep its context; leave the fingerprint alone.







[Multiple Steam accounts on one PC: switching and sharing](https://mosaicbrowser.com/guides/multiple-steam-accounts-on-one-pc): Multiple Steam accounts on one PC: the client remembers each and switches with a restart. Two at once, or one shared library, need a different route.

## Run this guide on your own accounts

Every Mosaic profile is a fingerprint, a proxy IP and a cookie jar that agree with each other, kept on your computer. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
