Delete Cookies on Page Refresh #419
-
Hi, Cookies are only disabled if they are defined in autoClear section, right? Shouldn't autoClear run every time page refreshes? In my tests when I reject cookies, they get deleted. But when I refresh the page they come back again. Is it an expected behaviour? I am testing on cookieconsent v3.0.0-rc.4 and using default 'opt-in' modeç |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
I cannot reproduce this issue (using rc.9). Can you provide a demo? |
Beta Was this translation helpful? Give feedback.
-
@orestbida Thank you very much for your support! I have deployed my local app to heroku: |
Beta Was this translation helpful? Give feedback.
-
It looks like you are not blocking the scripts (gtag, hotjar ...) and that's why cookies are immediately set on the next page load. You must block the tracking scripts by default, and let the plugin enable them only when the related category is enabled. Check out the Scripts Management section on how to do so. |
Beta Was this translation helpful? Give feedback.
-
Thanks @orestbida. As an alternative solution; I will try to trigger cc.eraseCookies function in the onConsent event for rejected cookies so that in every page those cookies are deleted. Is this a bad practice? I am suggesting this kind of solution as it is more plug and play. You just check an applications cookies, prepare the config and tell developer to import it. Otherwise it can be hard to assure Cookie Consent is implemented correctly on every web app in a large company. |
Beta Was this translation helpful? Give feedback.
@petekyetke
It looks like you are not blocking the scripts (gtag, hotjar ...) and that's why cookies are immediately set on the next page load. You must block the tracking scripts by default, and let the plugin enable them only when the related category is enabled. Check out the Scripts Management section on how to do so.