Profiles and sign-ins
A profile is a browser’s memory: cookies, localStorage, IndexedDB, service workers and saved logins. A session started with a profile begins where the last one left off, and saves it back when it stops. Sign in to a site once, and every later session with that profile is signed in.
Every cookie is kept, session cookies (those without an expiry, which Chrome itself forgets when it closes) included. sessionStorage is not: it belongs to a tab, and the next session starts with new tabs.
Create one and use it
Section titled “Create one and use it”profile = client.profiles.create(name="Shopify admin")browser = client.browsers.create(profile_id=profile.id, timeout=30)Or create it on the dashboard’s Profiles page.
The profile is saved when the browser stops, so stop it rather than letting it time out when the sign-in matters
(a timeout saves too, but your agent may have left mid-step). Each save is a new version; the version before stays
until the next save succeeds, so a lost machine never corrupts a profile.
Sign in as a person
Section titled “Sign in as a person”Some sign-ins need a person: a one-time code, a passkey, a CAPTCHA. On the dashboard’s Profiles page, Open to sign in starts a browser with the profile and opens its live view. Sign in, close the tab, and stop the browser: the profile now holds the session. Your agents’ browsers with that profile start signed in.
You can do the same from code: start a browser with the profile, open its liveUrl yourself, and stop it when done.
Several browsers on one profile
Section titled “Several browsers on one profile”A profile can run in several browsers at once. Every create request with the profile starts a browser of its own, with
its own id, cdpUrl, timeout and charge, and the profile is shared live between them: a cookie (httpOnly
included) or localStorage change in one browser reaches the others within about a second. Sign in in one, and the
others are signed in.
first = client.browsers.create(profile_id=profile.id)second = client.browsers.create(profile_id=profile.id) # another browser, signed in as the first- A browser that starts while others run begins with the profile as they have it now, not as it was last saved.
- Shared: every cookie, and each site’s own localStorage. An open page gets the
storageevent another tab would have given it. - Not shared: sessionStorage, IndexedDB, and the localStorage of a frame embedded in another site. A localStorage value over 1 MB is not shared either.
- Each browser saves the profile when it stops. The one that stops last writes the version that stays: it has the cookies and localStorage of all of them, and its own IndexedDB.
- When two browsers change the same cookie or key at the same moment, both end with the same value.
- With a residential proxy, each browser has its own address. A site that ties a login to one address may ask a second browser to sign in again.
To have several agents work in one browser instead, give them the same cdpUrl: a browser takes any number of
connections.
Importing into a profile, deleting it, or going back to an earlier version needs its browsers stopped first
(409 profile_in_use).
Profile settings
Section titled “Profile settings”Settings apply to every session started with the profile. A create request can ask for another proxy or screen size; the locale and the time zone are the profile’s alone:
{ "name": "Shop in Germany", "settings": { "proxy": { "country": "de", "sticky": true }, "screen": { "width": 1440, "height": 900 }, "locale": "de-DE", "timezone": "Europe/Berlin" }}A site that saw a German address at sign-in may ask again from elsewhere, so a profile’s proxy keeps its sessions in
one country. Chrome’s time zone follows the proxy’s address by itself; its language does not, so set locale to match
the country. A timezone here fixes the zone whatever the address.
An organization has 100 profiles at most, and a profile’s last 3 saved versions are kept.
Import your Chrome profile
Section titled “Import your Chrome profile”Bring a profile you already use, on the dashboard (Import on a profile) or with
POST /profiles/{id}/import. Imports add up: a folder, then a
storage state.
| Upload | What comes along |
|---|---|
A profile folder, zipped (application/zip, 50 MB at most): a user-data-dir, or one profile folder such as Default |
localStorage, IndexedDB, service workers, preferences and history. Cookies and passwords only when they are not encrypted with a key of your machine, which is rare on Windows and macOS. |
A storage state (application/json, 20 MB at most), what Playwright’s storage_state() writes |
Its cookies and each origin’s localStorage. |
So from Windows or macOS, send both: the zipped folder for storage, and a storage state for cookies, written by Playwright with the profile’s browser closed:
from playwright.sync_api import sync_playwright
with sync_playwright() as p: context = p.chromium.launch_persistent_context("<your profile folder>", channel="chrome", headless=True) context.storage_state(path="storage-state.json") context.close()Each import runs as a short session and is charged as one. Sites that bind a session to its device (Google on Windows, some banks) or to an IP address may still ask you to sign in again.