FREE EU Cookie Law Script

The EU Cookie Law deadline was the 26th May and if you haven’t already implemented the changes then we’ve put together a little bit of code to help you. Feel free to use this script on your site. A link back to our site would be grateful but not mandatory. Also, please do leave a message saying where and how you’ve implemented it.

Bear in mind you’ll still need to get your web developer to add this to your site as this is just the bare bones version and you’ll need to style it up a bit. If you haven’t already clicked “Accept” on the Dare to Think site then you’ll see how we’ve added a banner to the top of the site.

If you need either script added to your site or you’re unsure where to start please do get in touch for a quote.

NOTE 14/6/12: Thanks to Pete Norris of Liquid Engine as I think he’s managed to solve the mysterious reason why these scripts weren’t working in IE. I’ve changed the scripts below as well as uploaded new files for you to download

Version 1 – The user clicks “Accept” before the message is removed

This shows a message to the user and they must click the “Accept” button before the message is removed. After they click the link then a cookie is stored on their computer so the message doesn’t display again until the year 2022!! If you would like to change the cookie expiry date then change the 365*10 code below (365 is the number of days and 10 is the number of years).

Download version 1 of the Free EU Cookie law script now

Version 2 – The user only sees the message once

This shows a message to the user once and then stores the cookie so it is never shown again.

Download version 2 the Free EU Cookie Law script now

37 Responses to FREE EU Cookie Law Script

  1. Keith Redo says:

    Thanks guys! I need to get this script working on my site… I downloaded and uploaded it and now I need to figure out how to configure it.

  2. Teresa Bowen says:

    Thank you so very much for this code. I have been struggling to find something like this for my site and this is perfect. It just works!

  3. Guest1234 says:

    Hi. So where is my cookies are? Where does it store to view it?

  4. Jacob says:

    I like this; it would be even better if the second one had a click to close button like the first one does – I can see people wanting to close it right away and not being able to do so.

    I’m trying to get such a button to work … but my JavaScript is on a par with my French …

    • daretothink says:

      Hi Jacob. Unfortunately I do not have any spare time at present to implement this request. You could try this script and adding a button with the class of “remove”.

          $(“.remove”).click(function () {      $(this).parent().remove();    });

  5. Pete says:

    Thanks for the code, do you have to have jQuery 1.7.2 for this to work or will it work with jQuery 1.7.1? I’ve implemented it onto my Magento site and it’s breaking my drop down navigation and AJAX layered navigation. Don’t really know anything about jQuery so don’t know how to fix it

    • Pete says:

      It’s only breaking when I use . If I remove it to use the jQuery already on the site it doesn’t work at all. PS. I’m not the same Pete that says it doesn’t work in Internet Explorer.

      • Pete says:

        I’ve worked it out now, jQuery wasn’t loading properly so I changed $(“eucookielaw”).show(); to jQuery(“eucookielaw”).show(); and that’s sorted it. You can see it here

        • daretothink says:

          Thanks for letting me know. Yes, I sometimes have this where sometimes I need to use $ and sometimes jQuery!

          • Pete says:

             Yeah, something I have only just learnt 🙂 also I’ve tried this in IE8, IE9, Firefox, Google Chrome on Windows and Safari, Firefox and Google Chrome on OS X and it works on all of them. So thank you very much for the code

  6. Pete says:

    Doesn’t work in Internet Explorer

    • daretothink says:

      What version? What OS? Works perfectly on my Windows 7 running IE9 and then running IE8 and IE7 within.

  7. I have one at or

  8. Hi, Nice script. What is the jquery include needed for?

    • daretothink says:

      Thanks. That’s there so the .remove and .show work. If you remove it the div will not appear.

      • Ah great, thanks for your reply. We used the downloadable zip version and it works in IE8 but not  IE9

        • daretothink says:

          I’ve tested this in IE7, 8 and 9 as well as FF, Chrome and Safari on both Mac and PC. Are you sure you’re clearing your cache in IE each time you test it? Do so by going to Tools > Safety > Delete Browsing History and make sure the Cookies checkbox is checked.

          • oh yes, definitely clearing cache, deleting cookies, etc; it just displays, but doesn’t go away. seems it is not setting the cookie, even when we have accept all cookies selected and most minimal security settings.

          • daretothink says:

            Hi Michael. That’s very strange. Do you have a link to which I can see this in action?

          • daretothink says:

            Just tested that site on a Mac (Safari, Chrome and Firefox) and PC (IE9, IE8, IE7, Chrome, Safari, Firefox) and is working on all.

          • Hmm, I wonder then, I was having significant problems on windows xp and ie 8 on my machine and also on a VM on linux running xp and ie8. our windows 7 machine and ie 9 isnt working for any of the urls

          • daretothink says:

            Hmm, indeed. I don’t really know what to suggest Michael. I’m very sorry I can’t be of any further help.

          • I’m having the same difficulty as Michael with IE9. Are you using the code as available in the download to test or the code as implemented on your site?
   or neither work with IE9

          • daretothink says:

            Hi John. Both of those are working in IE9 on my machine. I’m using Parallels Desktop on my Mac to run Windows 7 with IE9 installed.

          • daretothink says:

            I have set up two test urls: (will set a cookie called dttcookie1) and (will set a cookie called dttcookie2)

          • Alan, I’ve changed my browsing settings to accept all cookies but to prompt for each one. On this page the cookie for your script comes up in the prompts along with Google Analytics, Disqus etc etc. Clicking accept does not clear the bar and even refresh straight afterwards does not get rid of it for me.
            My links do not prompt me to allow a cookie and neither do the two URLs above.
            Getting some strong reminders why I gave up IE years ago…

          • daretothink says:

            It’s always frustrating when I can’t replicate the issues you are experiencing. I’ll try to have another delve into the mysterious world of IE at the weekend and report back. I have your email address so I’ll email you directly if I manage to find anything.

          • Thank you. I may well go ahead with it in any case as it works well on Firefox, Chrome, SeaMonkey. The worst case scenario is that it just remains at the top of each page.

          • I’m no programmer, but I also couldn’t get it working in IE7 and IE8…. 
            However removing the 2 console lines of code fixed it.

            Thanks for the code!

          • daretothink says:

            Thanks Peter. I’ve amended the code above and for the downloads and hopefully this should work for all now.

  9. Inkwnothing says:

    Sorry, but neither work using IE

    • daretothink says:

      Hi. Thanks for pointing that out. It appears that when you copy and pasted the script direct from the site that it somehow broke the script. Very strange and it did the same for me. I’ve now added downloadable files instead. Please try again and let me know how you get on.

    • daretothink says:

      I’ve now also fixed the code above so you can either download it or simply copy. Let me know how you get on.

Leave a Reply

Your email address will not be published.