Maintain browser state across Live sessions
Enable persistence of browser cookies across Live sessions to maintain consistent test environments.
When you switch browsers or start a new session on BrowserStack Live, cookies from the previous session are lost. As a result, you need to repeat setup steps when you start a new session.
Browser State Maintenance preserves your browser’s cookies across sessions. This feature reduces setup time by restoring your previous session’s cookie state.
- Currently, Browser State Maintenance preserves only cookies across sessions.
- BrowserStack securely stores cookies for 30 days. If you deactivate your BrowserStack account, all stored cookies are automatically deleted.
How it helps
- Reduce setup time: Eliminates the need to log in to websites in each session.
- Increase productivity: Focus on testing your app instead of repeating browser setup steps.
- Maintain cookies: Keep cookies intact across sessions to test user-specific features without repeated authentication.
Supported session configurations
- This feature is currently supported only on Android and iOS devices with Chrome or Safari browsers.
- The feature is supported when testing with multiple devices in a single tab. For more information, see Browser State Maintenance with Multi-device Testing.
Enable Browser State Maintenance
When you end a BrowserStack Live test session for the first time, a pop-up appears asking if you want to persist cookies across sessions.
Click Persist cookies to enable the feature.
To manually enable Browser State Maintenance during a Live test session:
- Log in to the Live dashboard.
- On the Live dashboard, select the device, OS version, and browser to start your test session.
- In the Live vertical toolbar, click Settings.
- In the Settings prompt, switch on the Persist cookies for future sessions toggle.
The setting is saved, and a banner appears at the top of the screen indicating that cookies will be persisted and restored across sessions.
Disable Browser State Maintenance
When you disable Browser State Maintenance, cookies will not persist across sessions. However, cookies are securely stored for 30 days. If you re-enable Browser State Maintenance within this period, cookies will be restored.
To disable Browser State Maintenance:
- Log in to the Live dashboard.
- On the Live dashboard, select the device, OS version, and browser to start your test session.
- In the Live vertical toolbar, click Settings.
- In the Settings prompt, switch off the Persist cookies for future sessions toggle.
The setting is saved, and a banner appears at the top of the screen indicating that cookies will not be persisted across sessions.
An option to clear stored cookies appears under the Persist cookies for future sessions toggle.
Delete stored cookies
To delete your stored cookies:
- Log in to the Live dashboard.
- On the Live dashboard, select the device, OS version, and browser to start your test session.
- In the Live vertical toolbar, click Settings.
- In the Settings prompt, click Clear stored cookies below the Persist cookies for future sessions toggle.
A banner appears at the top of the screen, indicating that cookies will be deleted after you end the session.
Browser State Maintenance with Multi-device Testing
BrowserStack Live supports Browser State Maintenance when testing with multiple devices in a single tab, also known as Multi-device Testing. When you start a multi-device testing session, the cookies of your last active device are persisted and shared across all devices in the multi-device session. Currently, only Multi-device Testing in a single tab supports Browser State Maintenance.
Manage Browser State Maintenance in a Multi-device Testing session
To manage Browser State Maintenance when testing with multiple devices in a single tab:
- Log in to the Live dashboard.
- Select your preferred device-browser combination to run your website or web app.
- Hover the cursor over the Plus sign on the right side of the screen and click the + Add Device button when it appears.
- In the device and browser selection window, choose another device-browser combination.
- Repeat steps 3 and 4 to add up to three additional devices.
- In the Live vertical toolbar, click Settings.
- To enable Browser State Maintenance, switch on the Persist cookies for future sessions toggle in the Settings prompt under the State maintenance section.
The setting is saved, and a banner appears at the top of the screen indicating that cookies will be persisted and restored across sessions. - To disable Browser State Maintenance, switch off the Persist cookies for future sessions toggle.
The setting is saved, and a banner appears at the top of the screen indicating that cookies will not be persisted across sessions.
Delete stored cookies in a Multi-device Testing session
To delete your stored cookies for all devices in a Multi-device Testing session:
- Log in to the Live dashboard.
- Select your preferred device-browser combination to run your website or web app.
- Hover the cursor over the Plus sign on the right side of the screen and click the + Add Device button when it appears.
- In the device and browser selection window, choose another device-browser combination.
- In the Settings prompt, click Clear stored cookies below the Persist cookies for future sessions toggle.
A banner appears at the top of the screen, indicating that cookies will be cleared after you end the session.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!