New issue
Advanced search Search tips
Starred by 12 users

Issue metadata

Status: Available
Owner: ----



Sign in to add a comment

Add Cookie is not spec compliant

Project Member Reported by kereliuk@chromium.org, Sep 8 2017

Issue description

spec: https://w3c.github.io/webdriver/webdriver-spec.html#add-cookie

The implementation differs in at least the error code we return for trying to get the cookie object from parameters.
 
Project Member

Comment 2 by gmanikpure@chromium.org, Sep 19 2017

Cc: kereliuk@chromium.org
Labels: ChromeDriver-2.33
Owner: gmanikpure@chromium.org
Status: Fixed (was: Available)
Project Member

Comment 3 by kereliuk@chromium.org, Sep 19 2017

Status: Unconfirmed (was: Fixed)
We need to re-audit the add cookie command and check that it is spec compliant everywhere else. After that we can update this doc: https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md
Project Member

Comment 4 by bugdroid1@chromium.org, Sep 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3371c2f42e356fb19f6004e6ef770e4dba6c3575

commit 3371c2f42e356fb19f6004e6ef770e4dba6c3575
Author: Gauri Manikpure <gmanikpure@chromium.org>
Date: Fri Sep 22 23:22:17 2017

[Chromedriver] Return InvalidArgument error if required keys are missing in cookie data.

Bug: chromedriver:2002
Change-Id: Ie2d51fdba57e7a0e0dd7eb44be1529b6cd43d2c8
Reviewed-on: https://chromium-review.googlesource.com/678922
Reviewed-by: Shuotao Gao <stgao@chromium.org>
Commit-Queue: Gauri Manikpure <gmanikpure@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503900}
[modify] https://crrev.com/3371c2f42e356fb19f6004e6ef770e4dba6c3575/chrome/test/chromedriver/window_commands.cc

Project Member

Comment 5 by johnchen@chromium.org, Oct 9 2017

Cc: -kereliuk@chromium.org
Owner: kereliuk@chromium.org

Comment 6 by mikl...@gmail.com, Oct 30 2017

whatever you did in v2.33.. it broke addCookie() and deleteAllCookies()

Comment 7 by mikl...@gmail.com, Oct 30 2017

Correction: deleteAllCookies() still works.


Project Member

Comment 8 by johnchen@chromium.org, Oct 30 2017

miklesw@gmail.com: Could you please provide your code to repro the failure, and/or verbose log from ChromeDriver? v2.33 has passed all our addCookie test cases, and there isn't much we can do unless you provide some more details. Thanks.

Comment 9 by mikl...@gmail.com, Oct 30 2017

Here's the verbose log and code snippet (pages and domains renamed):

driver.get(this.baseUrl + "/publicpage.html");
driver.manage().deleteAllCookies();
Cookie seleniumCookie = new Cookie("token", "value","tst.domain.com", "/", null, false, true);
driver.manage().addCookie(seleniumCookie);
driver.get(baseUrl + "/privatepage.html");
chromedriver.log
226 KB View Download

Comment 10 by mikl...@gmail.com, Oct 30 2017

johnchen@chromium.org: details provided

Comment 11 by mikl...@gmail.com, Oct 31 2017

Also, this used to work fine before upgrading.

When switching to htmlunit it starts working again.
I am running into the same issue.  No error. No cookie added.

Cookie apiCookie = new Cookie.Builder("MyCookie", "CookieValue")
                .domain("mysite.org")
                .isHttpOnly(false)
                .isSecure(true)
                .path("/")
                .build();
webDriver.get().manage().addCookie(apiCookie);

Comment 13 by mikl...@gmail.com, Nov 15 2017

johnchen@chromium.org: did you manage to reporoduce this issue?

Comment 14 Deleted

Comment 15 by mikl...@gmail.com, Dec 22 2017

Any chance of getting this sorted in chromedriver 2.35? (been waiting for the headless ignore cert fix, but can't use it with this regression) 
Hello,
For current ChromeDriver implementation (ChromeDriver v2.33 (2017-10-03)), domain property is interpreted incorrectly. "foo.com" WILL NOT be treated in the same way as ".foo.com", as "The prepending dot is optional in recent standards, but can be added for compatibility with RFC 2109 based implementations"
(https://en.wikipedia.org/wiki/HTTP_cookie#Domain_and_path) states.

Would greatly appreciate a fix.
Project Member

Comment 17 by kereliuk@chromium.org, Jul 26

Owner: ----
Status: Untriaged (was: Unconfirmed)
Project Member

Comment 18 by johnchen@chromium.org, Jul 31

Labels: StandardsCompliance Pri-2
Status: Available (was: Untriaged)

Sign in to add a comment