<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>20975</bug_id>
          
          <creation_ts>2013-02-12 12:24:50 +0000</creation_ts>
          <short_desc>[WebDriver Spec]: Undefined behaviour for Cookie setting against a Session that has had no Navigation yet</short_desc>
          <delta_ts>2014-07-21 23:45:59 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Browser Test/Tools WG</product>
          <component>WebDriver</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>20860</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan De Marino">detronizator</reporter>
          <assigned_to name="Simon Stewart">simon.m.stewart</assigned_to>
          <cc>dburns</cc>
    
    <cc>metanata4</cc>
    
    <cc>mike</cc>
          
          <qa_contact name="Browser Testing and Tools WG">public-browser-tools-testing</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82987</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan De Marino">detronizator</who>
    <bug_when>2013-02-12 12:24:50 +0000</bug_when>
    <thetext>There is a corner case not covered in the Cookies section of the document (https://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html#cookies).

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

The operation to SET/ADD a Cookie allows, in the input object, allows to omit the &quot;domain&quot; field. Current implementations of the specs &quot;silently fill&quot; 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 &quot;domain less&quot; (see above), cannot &quot;fill&quot; that &quot;domain&quot; field if an attempt to set a cookie without domain is made.

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


Hence, it&apos;s important to define what should ACTUALLY happen in this scenario.

SUGGESTION: ChromeDriver behaviour is correct. Setting a cookie on a &quot;domain less&quot; page should be forbidden and throwing an error/exception.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101394</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan De Marino">detronizator</who>
    <bug_when>2014-02-25 20:00:40 +0000</bug_when>
    <thetext>Glad to see this has been assigned to Simon.

@Simon: what&apos;s the initial thought on this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109153</commentid>
    <comment_count>2</comment_count>
    <who name="David Burns :automatedtester">dburns</who>
    <bug_when>2014-07-21 23:45:59 +0000</bug_when>
    <thetext>https://dvcs.w3.org/hg/webdriver/rev/2964b4c64afa</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>