Code Monkey home page Code Monkey logo

Comments (14)

zytzagoo avatar zytzagoo commented on September 13, 2024

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?

from cookie-banner.

fabiocaccamo avatar fabiocaccamo commented on September 13, 2024

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:

Screenshot 2022-11-15 at 15 25 43

I open the website with Chrome, I accept the cookie-policy and this is the cookie expiration date:

Screenshot 2022-11-15 at 15 27 21

This can't be an implementation problem.

from cookie-banner.

zytzagoo avatar zytzagoo commented on September 13, 2024

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:

Screenshot 2022-11-15 at 17 15 14

Screenshot 2022-11-15 at 17 35 15

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)

from cookie-banner.

fabiocaccamo avatar fabiocaccamo commented on September 13, 2024

Incredibile, I try to replicate it in smaller scale.

from cookie-banner.

zytzagoo avatar zytzagoo commented on September 13, 2024

Any luck finding out what's going on exactly?

from cookie-banner.

fabiocaccamo avatar fabiocaccamo commented on September 13, 2024

Sorry for the silence, I will isolate a test this week.

from cookie-banner.

fabiocaccamo avatar fabiocaccamo commented on September 13, 2024

@zytzagoo here the minimal test:

HTML

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": "&#10005;"
            });
            cookieBanner.run();
        </script>
    </body>
</html>

JS

cookiebanner.js file taken from master

COOKIE

This is the result cookie set on macOS Monterey 12.2.1 / Firefox 107.0.1:

Screenshot 2022-12-14 at 14 20 51

As you can see the default "infinite" expiration date doesn't work, it is set to one week.

from cookie-banner.

zytzagoo avatar zytzagoo commented on September 13, 2024

For me it behaves as expected, Firefox 107.0.0, macOS High Sierra (10.13.6), here are the screenshots:

Screen Shot 2022-12-15 at 12 34 20

Screen Shot 2022-12-15 at 12 34 38

Screen Shot 2022-12-15 at 12 34 53

from cookie-banner.

fabiocaccamo avatar fabiocaccamo commented on September 13, 2024

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.

from cookie-banner.

fabiocaccamo avatar fabiocaccamo commented on September 13, 2024

These the extensions I'm using, not too many and pretty popular:

Screenshot 2022-12-15 at 13 05 30

from cookie-banner.

zytzagoo avatar zytzagoo commented on September 13, 2024

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)

from cookie-banner.

fabiocaccamo avatar fabiocaccamo commented on September 13, 2024

I confirm it, I don't know why, but it's caused by the "DuckDuckGo Privacy Essentials" extension.

from cookie-banner.

zytzagoo avatar zytzagoo commented on September 13, 2024

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)

from cookie-banner.

fabiocaccamo avatar fabiocaccamo commented on September 13, 2024

ohhh didn't know that, thank you very much!

from cookie-banner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.