w3c / w3c/webdriver

Need clarification for cookie domain format

Open
#1,143 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The add cookie command doesn't spell out the exact format of the cookie domain value, based on the current behavior of browsers I think the expectation is something like:

  • if the cookie domain has a preceding dot character, the browser should ignore the dot character and create the cookie as a domain cookie
  • if the cookie domain does not have a preceding dot character, then the browser should still create a domain cookie
  • if the cookie domain field is absent in the request then the cookie should be created as a host only cookie

Similarly it is not clear how get named cookie should report the domain of the cookie. Firefox for example currently returns domain cookies with a preceding dot character, but host only cookies are represented by returning the value without a preceding dot character, to give an example
Domain cookie where domain is google.com:

"domain": ".google.com"

Host only cookie for google.com:

"domain": "google.com"

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 add cookie and get named cookie commands, then compare their documented domain handling with the browser examples in the issue. Clarify the expected treatment of leading dots, omitted domains, domain cookies, and host-only cookies, and update the relevant WebDriver specification text so both commands have an unambiguous definition.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.