• Resolved Bobosom

    (@bobosom)


    Hello guys. Thank you for plugin.

    I found weird behavior. I use plugin Cookie Notice & Compliance for GDPR / CCPA (https://www.ads-software.com/plugins/cookie-notice/).

    When is page cached after access from browser, cookie notice is there. But when is page preloaded, there is nothing from this plugin in preloaded html code. Whole plugin code is missing.

    I made some tests and changes in settings, but my knowledge is not enough.

    Please help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • @bobosom – you’ll probably want to use a different cookie plugin. One that detects if in an EU country using JavaScript.

    The PHP code that runs the cookie banner runs when the page is cached, which is wherever your server is when it’s preloaded.

    The Jetpack cookie banner works correctly. I primed the cache by loading a page from my US server and the banner still showed when I loaded it in the EU on my browser.

    Thread Starter Bobosom

    (@bobosom)

    @donncha

    Thank you for suggest. My site is only local thing and this simple solution was enough.

    Right now I wanted to write about findings.

    Cookie Notice & Compliance for GDPR / CCPA (https://www.ads-software.com/plugins/cookie-notice/) use something called Cookie_Notice_Bot_Detect. If Cookie Notice detect crawler in list of UserAgents, then do not show cookie baner. Between this crawlers is also WordPress. And that was a problem, because WordPress as UserAgent make preloading.

    When I erased ‘WordPress\/’, then preloading worked.

    Crawler list is in the file bot-detect.php.

    I hope it will help to someone.

    Plugin Support Alin (a11n)

    (@alinclamba)

    Hi @bobosom,

    Thank you for sharing those details. They might be helpful for others, indeed.

    Best!

    After having trouble with caching as well I had a look into the code.

    Guys, are you aware that your plugin is absolutely incompatible with caching?

    It’s even dangerous to use it since given consent from visitor 1 will be applied to visitor 2 and following ones. The only needed condition for reproducing this is that user 1 is the first visitor after a cache purge.

    I cannot believe that this behaviour is undetected since the early days of the plugin. However, it should be the first sentence of your plugin description that this plugin may lead to law violations and should never be used together with static page caching!

    Cheers.

    • This reply was modified 1 year, 1 month ago by Frank.
    Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    @t-mug – You can possibly make your cookie banner plugin work with caching enabled. I wrote a post many years ago about it.

    https://odd.blog/2018/07/20/wp-super-cache-and-cookie-banners/

    Thanks. I’ve read the article. It’s much easier to disable caching at all – the practical effect is exactly the same.

    This is because whether you need the cookie bar HTML which depends on a missing cookie which is checked on the server side by PHP – or you need the consent based JS code, which is only dumped into HTML when positively found a given consent by the cookie setting which is checked on the server side by PHP.

    So whatever you configure in Cache settings – you’ll cause switching off caching at all.

    The plugin does not work together with caching by design.

    You’d keep away a lot of trouble, frustration and wasted time from plugin users pointing that out in the plugin description on wp.org

    Cheers.

    Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    How would you cache pages that use a cookie banner that uses PHP?

    The cache key must include the same cookie that the cookie PHP code uses, which unfortunately creates a separate cache file. However, the visitor may still see a cached page that was generated by a previous visitor who chose the same cookie banner settings, as those settings are saved in the cookie.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Preloading do not cache Cookie Notice plugin’ is closed to new replies.