Closed minusnine closed 7 years ago
It's a bug in marionette. Here's a fix:
--- 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.
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.
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.
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