Allow Delete All Cookies to delete *all* browser cookies, regardless of the current domain

Open
#1,426 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
html
Domain
api, documentation

Research direction

Start by reviewing the WebDriver cookie-deletion specification and compare the Chrome and Firefox behaviors described in the issue. Read the related Capybara issue for the race condition, then determine whether the spec should require browser-wide deletion or define a separate endpoint; done means the chosen behavior is explicitly specified.

Written by the indexing model from the issue text.

Description

After #1149 was applied it's not clear whether "Delete All Cookies" should delete all cookies for the current domain/origin, or if it should delete all cookies for all domains stored by the browser.

Chrome and Firefox seem to treat this differently: Chrome will delete all cookies, regardless of the current address, but Firefox will delete only those cookies associated with the current domain.

The Firefox behavior causes a race condition when resetting a browser session in tests. In our case, using Capybara (please see the related issue), we delete cookies and then navigate to about:blank. Sometimes, after cookies have been cleared, a long-running ajax request sets a new cookie just before the browser leaves the page for about:blank. Once we return to the same domain we cannot be sure that the browser didn't set any cookies (and that leads to flaky test failures).

It would help to clarify in spec that the browser should delete all cookies, regardless of the current address (i.e. to standardize Chrome behavior). Alternatively, a new API endpoint could be added that explicitly deletes all browser cookies.

Dominant language
HTML
Stars
718
Forks
228
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from w3c/webdriver

All issues in w3c/webdriver

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.