Fragment caching and cookies not working
-
I’m trying to add a box that should be shown until the user ticks it off. I’m using a cookie to determine whether the user has chosen to hide the box and I’ve wrapped the box in mfunc tags to prevent caching – unfortunately, it seems very sporadic whether this works or not (sometimes it seems to work on some subpages, etc.).
I’m doing something like this:
<!-- mfunc mysecretcode --> if (!isset($_COOKIE["mycookie"])) { echo 'the box goes here, <a onclick="jqueryAjaxSetCookie();">click to hide</a>'; } <!-- /mfunc mysecretcode -->
It works flawlessly when I’m logged in as admin and caching is disabled – as soon as I’m not, it breaks. I’ve verified that the cookie is being set using a cookie inspection addon for my browser.
Anyone have any ideas? Thanks in advance!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Fragment caching and cookies not working’ is closed to new replies.