I have a Cookie Consent popup that should display just once per user.
Ideally when the visitor clicks the “Agree” button a cookie gets set that expires after one year. The popup is supposed to NOT appear to people who have that cookie. This works fine when the site is not being cached through Cloudflare.
But whenever the popup appears to someone the page they visited is cached and whenever anyone else visits that page they see the popup regardless of whether they have a cookie or not.
I have tried page rules that will only cache when the cookie is present but it doesn’t work. I can’t imagine why “bypass cache” for the cookie would help because then no page would ever get cached.
My page rules all use “cache everything” because it is the only way to cache the html and take the load off of the database. It is a very active News site.
I don’t understand why I haven’t seen anyone else with this problem.
I put the Cookie Consent popup on my dev site, http://dev.railjournal.com so you can see this problem in action.
Can someone help me with this? What am I no understanding?