Skip to main content
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

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 devices and browsers

  • This feature is currently supported only for single-device mobile sessions on Chrome or Safari browsers.

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:

  1. Log in to the Live dashboard.
  2. On the Live dashboard, select the device, OS version, and browser to start your test session.
  3. In the Live vertical toolbar, click Settings.
  4. In the Settings prompt, switch on the Persist cookies for future sessions toggle. The settings prompt in a BrowserStack Live test session with the Persist cookies option highlighted.
    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:

  1. Log in to the Live dashboard.
  2. On the Live dashboard, select the device, OS version, and browser to start your test session.
  3. In the Live vertical toolbar, click Settings.
  4. In the Settings prompt, switch off the Persist cookies for future sessions toggle. The settings prompt in a BrowserStack Live test session with the Persist cookies option highlighted.
    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:

  1. Log in to the Live dashboard.
  2. On the Live dashboard, select the device, OS version, and browser to start your test session.
  3. In the Live vertical toolbar, click Settings.
  4. In the Settings prompt, click Clear stored cookies below the Persist cookies for future sessions toggle. The settings prompt in a BrowserStack Live test session with the Clear cookies option highlighted.
    A banner appears at the top of the screen, indicating that cookies will be deleted 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





Thank you for your valuable feedback

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle