Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Jan 28, 2020 23:59

Problem

Google will begin to impose new cookie policies by default for users beginning with Chrome 80, which is slated to be released in early 2020.

More details available here.

Solution

The code below shows how to enable experimental option "SameSite by default cookies" in remote cradle:

        ChromeOptions myChromeOptions = new ChromeOptions();


        HashMap<String, Object> chromeLocalStatePrefs = new HashMap<String, Object>();
        List<String> experimentalFlags = new ArrayList<String>();

        experimentalFlags.add("same-site-by-default-cookies@1");

        chromeLocalStatePrefs.put("browser.enabled_labs_experiments",experimentalFlags);

        myChromeOptions.setExperimentalOption("localState", chromeLocalStatePrefs);


        capabilities.setCapability(ChromeOptions.CAPABILITY, myChromeOptions);