-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookies do not return expiration dates #463
Comments
It's a bug in marionette. --- testing/marionette/driver.js 2017-06-07 18:09:34.316370300 +0100
+++ testing/marionette/driver.js 2017-06-07 18:58:49.413061100 +0100
@@ -3204,7 +3204,7 @@
"path": cookie.path,
"host": cookie.host,
"secure": cookie.isSecure,
- "expiry": cookie.expires,
+ "expiry": cookie.expiry,
"httpOnly": cookie.isHttpOnly,
"originAttributes": cookie.originAttributes
});
--- testing/marionette/listener.js 2017-06-07 18:09:34.345907100 +0100
+++ testing/marionette/listener.js 2017-06-07 22:25:57.650249200 +0100
@@ -1659,14 +1659,17 @@
let rv = [];
for (let cookie of cookies) {
- let expires = cookie.expires;
- // session cookie, don't return an expiry
- if (expires == 0) {
- expires = null;
+ let expiry = cookie.expiry;
+
+ // session cookie, don't return an expiry.
+ if (expiry > Number.MAX_SAFE_INTEGER) {
+ expiry = null;
+ }
// date before epoch time, cap to epoch
- } else if (expires == 1) {
- expires = 0;
+ else if (expiry < 0) {
+ expiry = 0;
}
+
rv.push({
'name': cookie.name,
'value': cookie.value,
@@ -1674,7 +1677,7 @@
'domain': cookie.host,
'secure': cookie.isSecure,
'httpOnly': cookie.httpOnly,
- 'expiry': expires
+ 'expiry': expiry
});
} |
+1, please fix. |
I’m very likely to fix this as part of https://bugzilla.mozilla.org/show_bug.cgi?id=1372595 because I have to write a WPT test for it. |
* response: add single cookie response type The WebDriver specification mandates that the GetNamedCookie command should return a cookie serialisation object, and not an array of cookies. This patch introduces WebDriverResponse::Cookie and CookieResponse types to allow WebDriver implementations to return single cookie objects. Fixes: mozilla/geckodriver#463
Hello. I'm using the latest geckodriver (0.18.0) with firefox 55 for selenium tests. When i get cookies in my tests they have no expiry parameter at all. I thought this bug was already fixed in 0.18.0. Am i doing something wrong? |
@pavel-morozov-duallab As you can tell from https://bugzilla.mozilla.org/show_bug.cgi?id=1372595, this was fixed in Firefox 56. |
* response: add single cookie response type The WebDriver specification mandates that the GetNamedCookie command should return a cookie serialisation object, and not an array of cookies. This patch introduces WebDriverResponse::Cookie and CookieResponse types to allow WebDriver implementations to return single cookie objects. Fixes: mozilla/geckodriver#463 Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: 9b49e5a6ec370e0da09521bfedcc596427c93cd5 committer: jgraham <james@hoppipolla.co.uk>
* response: add single cookie response type The WebDriver specification mandates that the GetNamedCookie command should return a cookie serialisation object, and not an array of cookies. This patch introduces WebDriverResponse::Cookie and CookieResponse types to allow WebDriver implementations to return single cookie objects. Fixes: mozilla/geckodriver#463 Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: 9b49e5a6ec370e0da09521bfedcc596427c93cd5 committer: jgraham <james@hoppipolla.co.uk> --HG-- extra : subtree_source : http%3A//tristan.corp.lon2.mozilla.com%3A8000 extra : subtree_revision : 097a285a79103c45e6274b6d48a5e8892d1272ca
* response: add single cookie response type The WebDriver specification mandates that the GetNamedCookie command should return a cookie serialisation object, and not an array of cookies. This patch introduces WebDriverResponse::Cookie and CookieResponse types to allow WebDriver implementations to return single cookie objects. Fixes: mozilla/geckodriver#463 Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: 9b49e5a6ec370e0da09521bfedcc596427c93cd5 committer: jgraham <james@hoppipolla.co.uk>
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue. |
* response: add single cookie response type The WebDriver specification mandates that the GetNamedCookie command should return a cookie serialisation object, and not an array of cookies. This patch introduces WebDriverResponse::Cookie and CookieResponse types to allow WebDriver implementations to return single cookie objects. Fixes: mozilla/geckodriver#463 Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: 9b49e5a6ec370e0da09521bfedcc596427c93cd5 committer: jgraham <jameshoppipolla.co.uk> UltraBlame original commit: ac919ddfbcc3db7ca10c0d5219caea795527e79e
* response: add single cookie response type The WebDriver specification mandates that the GetNamedCookie command should return a cookie serialisation object, and not an array of cookies. This patch introduces WebDriverResponse::Cookie and CookieResponse types to allow WebDriver implementations to return single cookie objects. Fixes: mozilla/geckodriver#463 Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: 9b49e5a6ec370e0da09521bfedcc596427c93cd5 committer: jgraham <jameshoppipolla.co.uk> UltraBlame original commit: ac919ddfbcc3db7ca10c0d5219caea795527e79e
* response: add single cookie response type The WebDriver specification mandates that the GetNamedCookie command should return a cookie serialisation object, and not an array of cookies. This patch introduces WebDriverResponse::Cookie and CookieResponse types to allow WebDriver implementations to return single cookie objects. Fixes: mozilla/geckodriver#463 Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: 9b49e5a6ec370e0da09521bfedcc596427c93cd5 committer: jgraham <jameshoppipolla.co.uk> UltraBlame original commit: ac919ddfbcc3db7ca10c0d5219caea795527e79e
I'm working on improving Selenium3+Firefox support for a Go-based WebDriver implementation:
https://github.com/tebeka/selenium/tree/topic/geckodriver
There are a number of issues that I've found that appear to be a regression from Selenium 2's interaction with older versions of Firefox.
This one is that cookies returned from either the "Get All Cookies" or "Get Named Cookies" do not include the expiration date in the response. A full transcript is below.
In summary, a cookie added with:
does not have the expiry date in the response to "Get Named Cookie" (and "Get All Cookies", but that is not shown here):
Firefox Version
Mozilla Firefox 54.0a1 (the latest nightly build)
Platform
Linux
Steps to reproduce -
The following assumes a working Go installation on Linux.
The above test will produce the output copied below.
Minimal HTML file
The minimal HTML file is a an empty page, since this is a cookie-related issue.
Log
The text was updated successfully, but these errors were encountered: