Persist and reuse browser session state (cookies, local storage) across sessions
Profiles let you capture browser state created during a session (cookies and local storage) and reuse it in later sessions. This is useful for persisting login state or other site preferences across browser sessions.
2. Start a browser session using the profile and save changes
After creating the profile, reference it by its name or id when creating a browser.
Set save_changes to true to persist any state created during this session back into the profile when the browser is closed.
3. Use the browser, then close it to persist the state
After using a browser with save_changes: true, closing the browser will save cookies and local storage into the profile.
Calling browser.close() does not save the profile state. You must explicitly delete the Kernel browser (or let the browser timeout) to persist the Profile.
Copy
Ask AI
console.log('Live view:', kernelBrowser.browser_live_view_url);// Navigate and create login state...await kernel.browsers.deleteByID(kernelBrowser.session_id);
You can load a profile into a browser after it has been created using the update browser endpoint.
Copy
Ask AI
// Create a browser without a profileconst kernelBrowser = await kernel.browsers.create();// Later, load a profile into the browserawait kernel.browsers.update(kernelBrowser.session_id, { profile: { name: 'profiles-demo' }});
You cannot load a profile into a browser that was already created with a profile. The browser must have been created without any profile configuration.
A profile’s name must be unique within your organization.
Profiles store cookies and local storage. Start the session with save_changes: true to write changes back when the browser is closed.
To keep a profile immutable for a run, omit save_changes (default) when creating the browser.
Multiple browsers in parallel can use the same profile, but only one browser should write (save_changes: true) to it at a time. Parallel browsers with save_changes: true may cause profile corruption and unpredictable behavior.
Profile data is encrypted end to end using a per-organization key.