Cookie notification across pages not working

I’ve followed the guide by Vincent Bidaux regarding cookies. All is well and it appears to work - almost. I see the notification on the homepage ok but when I navigate around other pages the notification vanishes, even though I have not accepted the popup message yet.

Interestingly if I go directly to any other page (using incognito browsing) the message does show up, but when I navigate to the homepage it doesn’t!

Here’s my share link:

You’ll have to amend the custom code to only set the cookie once the user clicks the dismiss button. Currently it’s setting the cookie on page load (when message is being shown), so it doesn’t display a second time anywhere on the same site.