klaro cookie is not set on Drupal CMS site
chrischaplow opened this issue · comments
Hi there,
I am setting up the klaro cookie banner with Google Tag manager.
It on a Drupal 9 live website and the banner appears and selections can be made, but no 'klaro' cookie is set.
The banner disapears on 'Accept' or 'Deny' but then reappears on page refresh as you would expect if the klaro cookie has not been set.
After cleaning out all domain cookies only ones to appear are __TAG_ASSISTANT and cf_clearance. (cloudflare)
I made a simple copy of my config on another one page html domain website to test and this works fine.
So I assume there is something in the Drupal CMS blocking Klaro from setting the cookie.
Does anybody recognize this issues?
or if not, can anybody explain where klaro sets the cookies, and what config option might need changing.
Thanks in advance
Chris
Hey @chrischaplow, can't say without looking at the code but it's possible that something overrides the document.cookie property. You could try switching the storage method to localStorage
to verify that. You can also look at the cookies that are being set in the developer console, and in the JS console you can verify that the document.cookie
property has not been tampered with.
It could also be that a content security policy (CSP) is restricting the setting of cookies.
Thanks @adewes after a little while our programmer discovered there was an older Drupal consent banner module still in place. Whilst the banner was disabled that module was still active. We uninstalled this module to fix the problem. Thanks for your suggestion.