• Resolved jspry

    (@jspry)


    I installed this plugin on my site in order to only serve the Cookie Notice box to EU visitors. I added the US to the list to test it (I am in the US), and everything worked fine, box popped up, etc. However, after I removed “US” and then tried to access the site (from the US), the site keeps trying to refresh and is not accessible at all. In other words, for countries excluded from seeing the notice, the site is not available.

    What could be causing this? I tried to purge cache from my browser and also cloudflare after installing the plugins and it did not seem to fix the issue. I have restored the site to a backup point so that it is not down but I need to get this up and running.

    Thanks!

    • This topic was modified 6 years, 6 months ago by jspry.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author wrigs1

    (@wrigs1)

    Hi jspry.

    I’ll start with a bit of background info that may help.

    When a browser requests a page Cookie Notice checks if its OWN cookie “cookie_notice_accepted” is installed.
    If it isn’t the visitor has not previously made a choice to accept/reject cookie and it serves a “sanitized” page.
    If the visitor then clicks to accept, then the javascript CN served to the browser creates “cookie_notice_accepted” with a value of “true”.
    If the visitor then clicks to refuse, then it is created with a value of “false”.

    Assuming, as you mentioned, that its not cache related then it looks like your browser still has CN’s cookie set to false (it should only be your browser that is affected, not other users – there is no need to rollback your server).

    In a real world situation this would not happen, users cannot change themselves fron EU to non EU. However for non EU visitors the CCA plugin does check whether the cookie was previously set to ‘false’ and if so changes its value to “true” and it worked for me; and as yet I don’t know why not for your testing.

    What browser are you using? I’ll test my end (unless its Safari – I don’t have an Apple)

    Have you tried another browser that has not been used as both EU and Non Eu for testing? It should work fine; if not it may be a caching issue but I can’t see how. The FAQ on the CCA download page mentions that Cloudflare’s “standard caching” option should be used. Do you have a wordpress caching plugin as well as Cloudflare? the same FAQ mentions that if caching it is only suitable for use with WPSC or Comet CAche when the country caching extension is installed.

    I was going to ask for site link – but I’ve inly just noticed you provided it. I’ll do some checking.

    • This reply was modified 6 years, 6 months ago by wrigs1.
    Plugin Author wrigs1

    (@wrigs1)

    Have you deactivated Cookie Notice?

    I cant see a cookie banner as either EU or non EU and no Cookie Notice cookie is set. Nor does HTML contain CN stylesheets.

    Thread Starter jspry

    (@jspry)

    Thank you for replying so quickly!

    Regarding your first message, I actually found out because another person e-mailed me (US-based) saying they couldn’t access the website so presumably they were not accessing it twice (before and after I added and removed US from the list) and yet the site was still down for them. I also tried on another device of mine that wasn’t used for the original test, and it was also down for me.

    Yes, I have restored the site to the point before I installed the plugins because of the site down issue. I do also have a staging site that I can use for testing. So, I have just tried to recreate the issue there. In other words, I followed the same steps, adding US to test and then removing US from the list. So, shortly it should be unaccessible if accessing from the US and not logged in to the site (oddly, even in the other circumstance, it would allow me to go to site/wp-admin and log in, and everything worked fine…it was only logged out users that would be getting the constant refresh issue).

    Last time it took a while (maybe an hour or so, for the issue to start).
    Here is the staging site: https://rxtranslations.staging.wpengine.com/

    Plugin Author wrigs1

    (@wrigs1)

    Hi jspry

    I have replicated the infinite refresh loop in a cached environment and uploaded a new version to fix. Cache should be cleared after update. This bug should not affect sites that aren’t caching but hopefully it will solve your issue – thanks for letting me know.

    Your issue seems to have all the hallmarks of caching (logged in users are not cached with many of these plugins – and your logged in users do not have a problem).

    Caching and geolocation in CCA (identifying whether visitor from Europe):

    Wordpress caching plugins: the only ones that will work with CCA are Comet and WP Supercache and you must also have installed the associated Coountry Caching Extension (Comet extension) (WPSC)

    If you are using any other caching plugin (I vaguely remember reading WP Engine doesn’t not allow other WP caching plugins but adds its own by default) if so (ignoring the bug) I can’t see how EU/non-EU visitors are being separately cached and served the right content.

    If using Cloudflare, its caching should be set as standard.

    hope this helps

    Thread Starter jspry

    (@jspry)

    You’re the best — thank you so much! It is working perfectly now.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Category Country Aware WordPress & Cookie Notice’ is closed to new replies.