This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20975 - [WebDriver Spec]: Undefined behaviour for Cookie setting against a Session that has had no Navigation yet
Summary: [WebDriver Spec]: Undefined behaviour for Cookie setting against a Session th...
Alias: None
Product: Browser Test/Tools WG
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Simon Stewart
QA Contact: Browser Testing and Tools WG
Depends on:
Blocks: 20860
  Show dependency treegraph
Reported: 2013-02-12 12:24 UTC by Ivan De Marino
Modified: 2014-07-21 23:45 UTC (History)
3 users (show)

See Also:


Description Ivan De Marino 2013-02-12 12:24:50 UTC
There is a corner case not covered in the Cookies section of the document (

When a WebDriver Session is first created, the Browser Window is "domain less". Most probably pointing at "about:blank" or some similar page.

The operation to SET/ADD a Cookie allows, in the input object, allows to omit the "domain" field. Current implementations of the specs "silently fill" the domain field for the user, with the domain of the current page.

There is a corner-case scenario though. When a new Session, still "domain less" (see above), cannot "fill" that "domain" field if an attempt to set a cookie without domain is made.

Current implementations behaviour:
- ChromeDriver: throws an error "Couldn't set cookie"
- FirefoxDriver: accepts and sets the cookie, and it's available for retrieval
- GhostDriver: accepts the cookie, but it's not available for retrieval

Hence, it's important to define what should ACTUALLY happen in this scenario.

SUGGESTION: ChromeDriver behaviour is correct. Setting a cookie on a "domain less" page should be forbidden and throwing an error/exception.
Comment 1 Ivan De Marino 2014-02-25 20:00:40 UTC
Glad to see this has been assigned to Simon.

@Simon: what's the initial thought on this?
Comment 2 David Burns :automatedtester 2014-07-21 23:45:59 UTC