Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & Test Observability
No Result Found

Allow all cookies

Cookies are allowed by default on Chrome and Firefox browsers. However to allow cookies on Safari browser, you need to use a specific capability.

If you are using BrowserStack SDK, you can set the following capabilities in the browserstack.yml file:

Capability Description Expected values
allowAllCookies Enable all cookies in Safari A string. Default is false.
true if you want to enable all cookies in Safari

You can allow all cookies in Safari as shown below:

browserstack.yml
Copy icon Copy

BrowserStack SDK is a plug-n-play solution that takes care of all the integration steps for you. Using the BrowserStack SDK is the recommended integration method for your project. To know more, visit the SDK core concepts page.

Capability Description Expected values
browserstack.safari.allowAllCookies Enable all cookies in Safari A string. Default is false.
true if you want to enable all cookies in Safari

For example, you can allow all cookies in Safari as shown below:

// Allowing all cookies in Safari

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browserstack.safari.allowAllCookies", "true")
// Allowing all cookies in Safari

var capabilities = {
 'browserstack.safari.allowAllCookies' : 'true'
}
// Allowing all cookies in Safari

// For Chrome browser
ChromeOptions capability = new ChromeOptions();
capability.AddAdditionalCapability("browserstack.safari.allowAllCookies", true);

// For Edge browser
EdgeOptions capability = new EdgeOptions();
capability.AddAdditionalCapability("browserstack.safari.allowAllCookies", true);

// For IE browser
InternetExplorerOptions capability = new InternetExplorerOptions();
capability.AddAdditionalCapability("browserstack.safari.allowAllCookies", true);

// For Firefox browser
FirefoxOptions capability = new FirefoxOptions();
capability.AddAdditionalCapability("browserstack.safari.allowAllCookies", true);
# Allowing all cookies in Safari

$caps = array(
 "browserstack.safari.allowAllCookies" => "true"
);
# Allowing all cookies in Safari

capabilities = {
 "browserstack.safari.allowAllCookies": "true"
}
# Allowing all cookies in Safari

caps = Selenium::WebDriver::Remote::Capabilities.new
caps["browserstack.safari.allowAllCookies"] = "true"
# Allowing all cookies in Safari

my $capabilities = {
  "browserstack.safari.allowAllCookies" => "true"
}

You can disallow cookies on Chrome and Firefox browsers using ChromeOptions and FirefoxProfile. Know more about disabling cookies

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