I noticed on my website that, for anonymous users, the banner doesn't stop to be shown after acceptance, when the user change page, the banner still blows up.
After the login the banner disappear.

Any solution or suggestion?

Thanks

Comments

Richard15 created an issue. See original summary.

mrfrankiegio’s picture

I've noticed the same behavior on my drupal site. I've done the update of the module and then it has started to make the popup appear every time the user loads a new page.
Anyone has any suggestion?

svenryen’s picture

@MrFrankieGio what version did you upgrade from? I'll look into the report. For now, could you try opening and re-saving the settings for the module?

perpignan’s picture

I've noticed the same problem on one of my website. This website have a 1.10 default jQuery version (with jQuery Update).
My others websites have 1.5 as default jQuery version and "EU cookie compliance" works on them.
Then, i test this module, above jQuery 1.8, this last version module doesn't work ! :(

RobertoGA’s picture

The banner doesn't stop to be shown too.

In my case, the problem is that the cookie never is written.

I've changed this line
$.cookie('cookie-agreed', status, {expires: date}), path: path, domain: domain});
by this line
$.cookie('cookie-agreed', status, {expires: date});
inside setStatus function and the issue was solved.

Domain will be saved correctly by default and the path written will be the root of the project.

hughworm’s picture

#5 Doesn't entirely fix it because function undateCheck() uses the path and also fails to delete the legacy cookie. Think I'll revert to previous version until it works.

finetuning’s picture

In my case the issue is caused by the updateCheck function (at the end of /sites/all/modules/eu_cookie_compliance/js/eu_cookie_compliance.js), that is resetting the cookies at every page load.
After disabling the function, the cookies are correctly created in the browser instead of being reset, and the banner doesn't appear any more after the first confirmation.

dunx’s picture

I have the same issue on updating from 1.14 to 1.17.
Cookie warning pops-up on every page.
On my site it does disappear when I start to scroll, but I'm assuming that's by design.
I have two cookies:
cookie-agreed-on and cookie-agreed

Any ideas? I'll revert to 1.14 for the time being

coreykck’s picture

Same of #7 for me, I wrote a little patch
Bye

Index: js/eu_cookie_compliance.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- js/eu_cookie_compliance.js	(date 1512460624000)
+++ js/eu_cookie_compliance.js	(date 1512460624000)
@@ -241,7 +241,8 @@
     var domain = Drupal.settings.eu_cookie_compliance.domain ? Drupal.settings.eu_cookie_compliance.domain : '';
     var path = Drupal.settings.basePath;
     var cookie;
-    if ((cookie = $.cookie(legacyCookie)) !== null) {
+    cookie = $.cookie(legacyCookie);
+    if (cookie !== null && cookie != "null" ) {
       $.cookie('cookie-agreed', cookie, { path:  path, domain: domain });
       $.cookie(legacyCookie, null, { path: path, domain: domain });
     }
chandravilas’s picture

I also face same problem but I had customize this issue using css drupal way..................

global $user;

if (in_array('place_role_here', $user->roles)) { // add role as per requirement anonymous, administrator etc as per your requirement

drupal_add_css("#your_banner_id { display: none;}", 'inline');

}

For me it's working now , hope this will help you....

nofue’s picture

Sadly, the patch in #9 doesn't work for me, the pop-up continues to unnerve visitors.

eddi86’s picture

just deactivate the function completely

c-tools’s picture

Thanks coreykck, proposed patch in #9 work fine for me

marco.b’s picture

Tahnks, proposed patch in #12 works fine for me.

tr-drupal’s picture

Hello,

I have the same issue after updating from 1.14 to 1.17. No matter if I click "Accept" or load a new page, the banner is always shown.

Not sure how to apply / test the patch...

If it helps:
When I first load the website, there is one cookie:

Name: cookie-agreed-de
Content: null

When I click "accept", another one is there:

Name: cookie-agreed
Content: 2

tr-drupal’s picture

Ok, applied the patch from the comment #12 and it seems to work fine now.

svenryen’s picture

StatusFileSize
new1.43 KB

We can't use the patch from #12 as it simply disables the upgrade check and won't carry over cookie values for sites that upgrade from e.g. 1.14 to 1.17+. The issue is with different versions of jquery.cookie being used. Here's a patch that fixes the issue, and still maintains the upgrade check.

  • svenryen committed 67ddacb on 7.x-1.x
    Issue #2908848 by svenryen, eddi86, coreykck: Banner doesn't stop to be...
svenryen’s picture

Status: Active » Fixed
svenryen’s picture

Status: Fixed » Closed (fixed)
tr-drupal’s picture

I'm afraid, but this issue still exists with 7.x-1.25. Once I got it to work correctly, but all other attempts fails and the banner keeps coming up. Not sure how it worked once. Tried F5, CTRL+R, another page... It's on my xampp VM, so can't post an URL to check.

Edit:
I think it's related to https://www.drupal.org/project/eu_cookie_compliance/issues/2994592 because I've seen disappearing cookies indeed.

vvc’s picture

Just adding my experience here (and apologies for not knowing how to create a patch in case this is useful)...
I found that the 7.x-1.25 version (I've just upgraded to that earlier today) was having the EU agreement cookie deleted immediately after setting. I googled plenty of possibilities and even applied the patches above but I still had the same issue (even after clearing all caches).
I was able to take a screenshot of the brief moment when the cookie existed and I then noticed that the domain had been given a "." dot prefix even though I had not specified that in the module settings. That is to say, the cookie domain was being set as ".www.somedomain.com" instead of "www.somedomain.com" (spot the prefixed dot). So I googled that aspect and I found this: https://stackoverflow.com/a/3865510 which seemed to fit what I was seeing. I tested that by modifying the line that previously read:

$.cookie(cookieName, status, { expires: date, path: path, domain: domain });

To this:

$.cookie(cookieName, status, { expires: date, path: path });

In other words, removing the specific cookie domain setting.
I then cleared the cache and reloaded my test page - and bingo - the cookie was set without the dot prefix, the cookie stayed in place and the EU Cookie Compliance functionality was back working again. Relief!

So it seems that the cookie was being deleted by the browser itself since it was not relevant to the page it was being set for.

I don't know if the above modification is valid for the rest of the module functionality - and I don't know how to prepare a patch (at the moment anyway) but I hope the above information helps anyone else with the same problem. If it's a workable patch then perhaps someone could make it official somehow.