Cookie Law
This is an open discussion with 1 reply, filed under General.
Search
I think the following should work if you add an element into your template(s) with a class of cookie-container
.
if (document.cookie.replace(/(?:(?:^|.*;s*)mysitenamecookies*=s*([^;]*).*$)|^.*$/, "$1") !== "true") { jQuery('.cookie-container').show(); document.cookie = "mysitenamecookie=true; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/"; }
Obviously you'll need to populate .cookie-container
with a relevant message.
This would show a banner to new visitors which would only show on their first pageview. Adding a close button to the container would be a simple enhancement that would be easy to achieve.
If you wanted to require people to acknowledge the warning, move the line that sets the cookie into a click handler rather than letting it happen automatically.
Create an account or sign in to comment.
Hallo, I need to set up a European cookie law banner. I tried the Cookie Law extension, but attaching the DS to a page makes the page blank.
Any alternative workaround? Already made JS?
Thanks!