Skip to main content
This guide creates a profile, writes browser state to it, and reuses the saved state in a later browser session.

1. Create a profile

Give the profile a meaningful name that is unique within your project.

2. Start a writer browser

Attach the profile by name or id. Set save_changes to true only when this browser owns writes to the profile.
Before starting more than one writer, read Sharing and concurrency. Profile saves replace the complete stored snapshot and don’t merge concurrent changes.

3. Use and delete the browser

Navigate, authenticate, or complete the part of the workflow whose state you want to retain. Then delete the Kernel browser to save the state.
Calling browser.close() only closes the Playwright connection. It doesn’t save the profile. You must delete the Kernel browser or let it time out.

4. Load the saved state

Create another browser with the same profile. Omit save_changes to keep the stored profile unchanged during this run.

Control the starting tab

By default, a profile restores its saved tabs. Pass start_url to discard those restored tabs and open a specific page when the browser starts.
The same behavior applies to browser pools configured with both a profile and a start URL.
Managed Auth controls the tab state of profiles attached to auth connections. Each login or automatic reauthentication starts with one tab at the configured login URL, or at the domain homepage when no login URL is configured. Successful authentication saves the resulting tab state. Failed and canceled sessions leave the profile unchanged.Set start_url when you create a browser if your automation requires a specific first page.

Load a profile after browser creation

You can attach a profile to a running browser that was created without one. Loading the profile restarts Chromium, so reconnect your CDP or Playwright client afterward.
You can’t load a profile into a browser that already has one. The browser must have been created without a profile configuration.

Rename and manage profiles

Renaming a profile doesn’t recreate or change its stored state. The new name must be unique within the project.
Use the Profiles API reference or CLI reference to list, inspect, download, rename, and delete profiles.