Closed fabiocaccamo closed 1 year ago
Hi, sorry for the delay, and sorry to have to say that it's kind of hard to give more concrete info without having/seeing/testing a minimal reproducible example somewhere.
I tried running the tests manually in latest Firefox on osx, nothing breaks there. But this doesn't really prove much (in and of itself).
Maybe we could come up with a test for this exact scenario and add it to the test suite, but first we'd probably want to figure out what exactly is failing in the first place? Is it Cookies.set(), or Cookies.get()? Or neither and it's just a "duration" issue? Why only 7 days? Very strange.
Could you provide a minimal reproducible example somewhere online (or just code/options for it) that demonstrates the exact issue you're having?
Hi, thank you for the feedback. This is the code I run:
let options = {
"message": "Our website uses cookies ...",
"linkmsg": "Cookie Policy",
"moreinfo": "/cookie-policy/",
"cookie": "cookie-consent",
"cookie-secure": (window.location.protocol === 'https:' ? true : false),
"close-text": "✕"
};
this._cookieBanner = new Cookiebanner(options);
this._cookieBanner.run();
As you can see I don't set the expiration date.
I now deleted the cookie from both Firefox and Chrome, then:
I open the website with Firefox, I accept the cookie-policy and this is the cookie expiration date:
I open the website with Chrome, I accept the cookie-policy and this is the cookie expiration date:
This can't be an implementation problem.
I cannot replicate :/
For me, in Firefox (107, osx), running either the test suite (via file:///) or serving up a blank demo page via http, I get the "expected" expiry dates:
Not sure what to do in order to prove the default/Infinity expiry in the tests suite though (since there is no way to get that data directly out of document.cookie)
Incredibile, I try to replicate it in smaller scale.
Any luck finding out what's going on exactly?
Sorry for the silence, I will isolate a test this week.
@zytzagoo here the minimal test:
cookiebanner.html
file with the following content:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>cookiebanner</title>
</head>
<body>
<script type="text/javascript" src="cookiebanner.js"></script>
<script type="text/javascript">
let cookieBanner = new Cookiebanner({
"message": "Our website uses cookies ...,",
"linkmsg": "Cookie Policy",
"moreinfo": "/cookie-policy.html",
"cookie": "test-cookiebanner",
"cookie-secure": (window.location.protocol === 'https:' ? true : false),
"close-text": "✕"
});
cookieBanner.run();
</script>
</body>
</html>
cookiebanner.js
file taken from master
This is the result cookie set on macOS Monterey 12.2.1
/ Firefox 107.0.1
:
As you can see the default "infinite" expiration date doesn't work, it is set to one week.
For me it behaves as expected, Firefox 107.0.0, macOS High Sierra (10.13.6), here are the screenshots:
Thank you for your feedback. I isolated the problem, it's caused by a browser extension. I try now to isolate also the extension that causes that.
These the extensions I'm using, not too many and pretty popular:
Perhaps something in your firefox profile (or install) is wonky -- did you maybe try a new/fresh profile (and/or [re]install) and see if the issue persists there?
I have uBlock Origin as well, so can't be that. The only other suspect could be DuckDuckGo Privacy Essentials maybe? (if it's really caused by an extension at all)
I confirm it, I don't know why, but it's caused by the "DuckDuckGo Privacy Essentials" extension.
It's a feature, described here: https://help.duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections/ -- search for '7-day' (1st party cookie protection)
ohhh didn't know that, thank you very much!
Hi, I'm not setting the
expires
option because the default valueInfinity
is ok in my case.I noticed that the cookie-banner shows from time to time after having agreed once, so I decided to set the
expires
option.Setting the option I noticed that the expiration date is always one week (I tried to set it using seconds and also explicit Date object).
Initially I though it was a problem of the option, but I tested the same code with Chrome and it works well, so it's a Firefox (v.106) issue.