w3c / w3c/webdriver

Get All Cookies and Get Named Cookie need to consider Partitioned Cookies

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

Nobody has claimed this yet.

Get All Cookies Get Named Cookie needs-discussion
Dominant language
HTML
Stars
718
Forks
228
PR merge metrics
No merged PRs in 30d

Description

It's currently not really possible to use Get All Cookies and Get Named Cookie with Partitioned Cookies (I haven't tested Delete All Cookies but we should probably do that).

It looks like we have undefined behavior, e.g. in the following scenario:

    document.cookie = "test0=a; Secure; Partitioned;";
    const cookies = await test_driver.get_all_cookies();
    const cookie = await test_driver.get_named_cookie("test0");

what are cookie and cookies in the above simple scenario? If you ask Chrome today, they're empty.

Because we did not have decent cookie spec infrastructure for a long time, the spec is a bit unclear on this, but I suspect that the intention is that any Cookie that is accessible to the current document (including HTTPOnly cookies) should be included in the return value, thus also partitioned cookies.

Note that this makes #1892 worse, because otherwise identical partitioned and unpartitioned cookies can both be accessible to the same context.

cc @annevk @bvandersloot-mozilla @dcthetall

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.

Research direction

Start with the Get All Cookies and Get Named Cookie entry points and the partitioned-cookie scenario in the issue. Determine the expected values for cookie and cookies, including whether accessible partitioned cookies are returned, and consider the related Delete All Cookies behavior. Done means the cookie commands have defined behavior for this case.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.