• Because Cookie Notice use PHP code to evaluate cookie and decide to show notice or not, plugin is not compatible with W3 Total Cache or, I believe, any other caching plugin that does store static pages. One of the options could be to add notice block at all times and use JavaScript to display it or hide – that could be enabled via setting in plugin configuration.

    https://www.ads-software.com/plugins/cookie-notice/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author dFactory

    (@dfactory)

    This is not true Gytis,

    CN is made in a way it works wirh W3 Total Cache, Super Cache and possibly other caching plugin. We’re using it, thousands of users too.

    But if you’re experiencing issues this might be an issue specific to your site / theme / plugins configuration.

    Thread Starter Gytis Repe?ka

    (@kelmas)

    Correct me if I’m wrong, but let’s assume following situation: visitor has accepted cookies yesterday, so cookie on his machine is present. Now today site admin updates one or another WordPress plugin and as advised by W3TC clears cache. Visitor comes to site today and let’s say he is the first to come after cache cleanup. As cookie is already present, Cookie Notice will not be rendered by PHP script and not included to HTML output. This HTML will be cached and therefore I assume another visitor won’t see Cookie Notice because cached HTML will be served.

    Or you think this is invalid use case?

    I can confirm that the scenario described by Gytis does appear to be a problem. To recreate on a test site, take 3 clean (no cookies or cache) browsers…

    1) Browser 1: Clear the W3TC Page Cache.
    2) Browser 2: Visit index page of site, accept cookie notice.
    3) Browser 1: Clear the Page Cache again.
    4) Browser 2: Reload index page of site (CTRL F5)
    5) Browser 3: Visit index page of site.

    You will find that at step 5 you do NOT see the cookie notice even though this is the first visit by this browser.

    Using..
    Wordpress 4.3
    W3TC 0.9.4.1 with Disk Enhanced Page Cache
    Cookie Notice 1.2.32

    I can also confirm this problem. This should happen with every caching plugin unless it serves individualy cached versions (for logged in users or via https maybe).

    Is this still a problem or has it been fixed in any updates? I have another strange problem with W3TC. If I enable cookie notice acceptance when users scroll the cookie notice message is not displayed for any new visitors. Maybee not releated at all but it seems like it only happens with W3TC.

    Plugin Author dFactory

    (@dfactory)

    I really don’t know why you experience issues with W3 Total Cache.

    We’re using both on dozens of sites without any issues.

    Problem might be general, if you’re using JS minify / compress in W3. This is a problematic feature, that’s often responsible for breaking JS scripts.

    Cookie Notice doesn’t use PHP to store / check notice data – it’s just pure JS that should not be affected by caching plugins.

    Regards,
    Bartosz / dfactory team

    Cookie Notice doesn’t use PHP to store / check notice data – it’s just pure JS that should not be affected by caching plugins.

    From cookie-notice.php (version 1.2.34) Line 662 to 667 >>

    /**
    	 * Checks if cookie is setted
    	 */
    	public function cookie_setted() {
    		return isset( $_COOKIE[self::$cookie['name']] );
    	}

    So this is not using PHP to check if the cookie is set?

    Plugin Author dFactory

    (@dfactory)

    This is helper method, used in cn_cookies_accepted() public function.

    It has nothing to do with handling of the cookie notice display.

    OK, I thought that this was checking for a cookie not being set before outputting the cookie notice…

    /**
    	 * Cookie notice output.
    	 */
    	public function add_cookie_notice() {
    		if ( ! $this->cookie_setted() ) {

    I guess I was wrong.

    @dfactory

    I have done some more testing and can confirm that the bug described above still exist. If you reload the page after emptying the W3TC cache and with a valid cookie the new cached page is missing the script with arguments and the link to front.js.

    I couldn’t find the cause to the other problem with cookie notice acceptance when users scroll but I managed to fix it by moving the script from the header to the footer. So I guess this problem was a mix of the bug above and the script placement.

    Many thanx f?r your help!

    I do encounter the exact same problem, as described by JohnSeddon, using Cookie Notice and Automattic’s WP Super Cache

    Please fix this issue too or we have to change plugin

    Same problem here. Cookie notice does not appear on starting page, only if you move to another page it pops up. Using W3C too, but without any JS minify.

    BTW: Just encountered, that the cookie notice does not work on every page. On my contact site, with a contact form implemented, it does not show up either. So – it is on the starting page and on the contact me site not working properly.
    Maybe that is a hint to resolve this issue?

    Same problem. I have deactivated minify and problem is still there.

    Maybe we have to exlude some files in w3 total cache configuration…

    Any help?

    @rualsi: This is not your topic. Its also 9 months old and references an older version of WordPress (and probably the plugin too)If you require assistance then, as per the Forum Welcome, please post your own topic.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Cookie Notice not compatible with W3 Total Cache’ is closed to new replies.