cookieBAR

a free & easy solution to the EU cookie law.

Why cookieBAR?

There is a lot of mystery and fuss surrounding the EU cookie legislation, but it's essentially really simple. Cookies are files used to track site activity and most websites use them. Site owners need to make the use of cookies very obvious to visitors.

cookieBAR makes it simple and clear to visitors that cookies are in use and tells them how to adjust browser settings if they are concerned.

Oh, and if you are using Wordpress, there's a plugin for you too

IMPORTANT NOTICE cookieBAR's CDN has switched to a new url system, so please update the script's url as soon as possible, from this
<script type="text/javascript" src="//cdn.jsdelivr.net/cookie-bar/latest/cookiebar-latest.js"></script>
to this
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/cookie-bar/cookiebar-latest.min.js"></script>
or use the Installation & Configuration tool to grab the new code.






How it works

cookieBAR is drop-in and forget. Written in pure vanilla javascript code, no jQuery or any other dependency needed. It shows up when needed and stay silent when not: If a website has some cookies or localStorage data set then the bar is shown, otherwhise nothing happens. This is configurable, anyway.

Once the user clicks 'Allow Cookies', cookieBAR will set a cookie for that domain with a name 'cookiebar' that will expire in 30 days. What this means is that the plugin will only show up once per domain (per month).

If a user decides to click "Disallow Cookies", cookieBAR will remove all the cookies and localStorage data (but it will show up again the first time a cookie is detected).

Why did I write this?

Because I needed it. I got the idea from Studio NEC's permissionbar, which was beautiful, but I needed something more configurable, multilanguage and not dependent upon jQuery or any other javascript framework. So I forked the original project on GitHub and started to add what I needed, concluding with a pull-request whose code was completely rewritten. Sadly, the original project seems stopped and nobody has even probably seen my modifications. Several months later I decided to add even more things and to give this plugin a place to be, which is why it became cookieBAR.

How many languages are supported?

Currently, the supported languages for cookieBAR are:

  • Catalan
  • Czech
  • Danish
  • Dutch
  • English
  • French
  • German
  • Hungarian
  • Italian
  • Spanish
  • Swedish
  • Polish
  • Portuguese
  • Romanian
  • Slovak
  • Slovenian
  • Swedish

The user language is automatically detected by the browser, but you can force a specific language by passing an optional parameter (see Installation).

If you want to help me with the translations, or add another language, please fork my Github repository and make a pull request with your additions.

News
  • 14.08.2017 - 1.5.27: Updated Polish translation.
  • 27.05.2017 - 1.5.26: Bugfix in CSS - default theme.
  • 05.05.2017 - 1.5.25: Fixed Slovenian translation.
  • 02.05.2017 - 1.5.24: Added Polish translation.
  • 27.04.2017 - 1.5.23: Added Slovenian translation.
  • 06.04.2017 - 1.5.22: Modified GeoIP lookups, added "skip GeoIp" option, added "hide details" option, new "Flying" theme.
  • 28.03.2017 - 1.5.21: Added Swedish translation.
  • 17.03.2017 - 1.5.20: Fix loading of language files, fix invalid CSS in altblack css
  • 25.11.2016 - 1.5.19: Update nl.html
  • 25.11.2016 - 1.5.19: Update nl.html
  • 12.10.2016 - 1.5.18: Fixed typo in en.html, updated fr.html, added Slovak translation, added Czech translation.
  • 02.10.2016 - 1.5.17: Optionally refresh page on CookieAllowed.
  • 30.06.2016 - 1.5.16: Add Croatia to EU list.
  • 19.05.2016 - 1.5.15: Added Danish translation.
  • 14.04.2016 - 1.5.14: Switched from freegeoip.net to freegeoip.io.
  • 05.04.2016 - 1.5.13: Added Romanian translation.
  • 13.03.2016 - 1.5.12: Added "scroll window to confirm" option.
  • 01.02.2016 - 1.5.11: Minor enhancements.
  • 28.12.2015 - 1.5.10: Added Portuguese translation.
  • 24.12.2015 - 1.5.9: Added Catalan and Spanish translation.
  • 20.12.2015 - 1.5.8: Added Dutch translation.
  • 10.12.2015 - 1.5.7: Switched back to freegeoip.
  • 03.11.2015 - 1.5.6: Improved French translation.
  • 19.09.2015 - 1.5.5: Removed the 'http' prefix for telize api.
  • 10.09.2015 - 1.5.4: Switched from freegeoip to telize.
  • 06.09.2015 - 1.5.3: Added minified CSS and JS, set GB and not UK for the cookieLaw states, fixed a bug when hiding the bar (margins were not correctly reset).
  • 04.08.2015 - 1.5.2: Added Hungarian and German, better English translation. Some other minor fixes.
  • 29.06.2015 - 1.5.0: You can specify wether third party or tracking cookies are in use, the bar is shown only in the countries affected by this law.
  • 30.05.2015 - 1.4.0: Show cookieBAR even when no cookies nor localStorage is detected (always show), added a "remember choice" duration config.
  • 27.05.2015 - 1.3.0: Both bar and modal box are now themeable. If you want to use your own theme, make a pull request on GitHub.
  • 25.05.2015 - 1.2.1: I have moved the cookieBAR plugin to jsDelivr, a shiny Content Delivery Network (CDN). It should be faster and more reliable. If you are still using the old //cookie-bar.eu path, you really should switch to the new path.
  • 20.05.2015 - 1.2.0: Fixed a nasty CSS bug that made the bar's text strange or even invisible at all.
Installation

You have two options if you decide to give cookieBAR a try:

  • The easy-peasy (and probably better) one: grab the code below and use the hosted version
  • Or, you can self-host it by yourself:
    1. Checkout the Github repository and place it somewhere in a folder within your website or your server. All of the files, including images and stylesheets, need to maintain it's relative structure - that is be in the same directory - for the plugin to work correctly.
    2. Grab the code you will find below and adjust the path.
If you need to add some configuration to it, please use the configurator below.
Configurator
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/cookie-bar/cookiebar-latest.min.js?"></script>

See a demo

Please note: If you select an option with the "NEW" tag, and you see it's not working on your website, please wait for a few days before reporting: the changes may still be propagating through the CDN and should be visible in a maximum of 10 days

Contributors (in order of appearance)

Code reviews, new functionalities, themes, languages... everything that can be useful for the users is very welcome. Plus, your name will be shown in this list :-)

  • LucaRainone
  • frantique
  • michael-simons
  • xoseperez
  • Frank van den Bosh
  • D9ping
  • utilsites
  • contentkraft
  • xterr
  • hchu2882
  • akar134
  • antoniocoratelli
  • YarmoM
  • canalmedia
  • jacmaes
  • pinhead84
  • Fredrik82
See the full GitHub's list
Special thanks to the donors
  • Marco Frabetti, Marc Sellier, Bastian Scheefe, Martin J Powell, Gilles Nguyen, Ulrich Wende, Luca Gilardoni, Simen Ness
Disclaimer

This program is free software. It comes without any warranty, to the extent permitted by applicable law. Use at your own risk and double check your local law before using it.

Need support? Please accept cookies and refresh the page :-)