On May 26th 2011 a new EU originated law came into effect that requires website owners to make significant changes to their sites and may fundamentally change the whole web browsing and shopping experience for everybody.This Cookie Law is amended privacy legislation that requires websites to obtain informed consent from visitors before they can store or retrieve any information on a computer or any other web connected device.
Cookie Control does just that, presenting users with clear information on whether cookies are present, linking to your privacy policy (where you should have specific information about what cookies are in use), and advising users on how to adjust browser settings and what cookies mean for them.
Features
- Compact pop-up with dark and light colour themes.
- Prevent users logging in until cookie consented.
- Other modules can integrate with cookie callbacks (see below).
- Configurable message and read more message.
- Link to an admin defined privacy policy node.
- Only apply cookie consent restrictions to specified countries or whole world.
3rd Party Module Support
A sub-module is bundled with Cookie Control which will disable Google Analytics from tracking a visitor until they give consent. Upon accepting cookies their first visit will be logged, along with any further page loads.
The cookie_googleanalytics.module also acts as an example of how to add support to your own Drupal module project.
Developers
Cookie Control provides a number of JavaScript functions that allow you to check if you can set cookies from the rest of your scripts. These are:
- CookieControl.cookieLawApplies(): This function checks if the cookie Law applies to the user that is accessing the site based on their location.
- CookieControl.consented(): This function checks that the user has consented to getting cookies.
- CookieControl.maySendCookies(): This function is a combination of the first two checks. Furthermore, this function will be updated as the law changes to include all the checks that are needed in order to set a cookie and therefore it is the one that is recommended to be used when checking if cookies can be set.
Please ensure that the Cookie Control script has loaded before these functions are called.
From within your Drupal module you can also append JavaScript functions to a list which will be executed when a visitor first accepts cookies, and on loading every subsequent page.
- hook_cookieaccept_alter(&$callbacks)
- hook_cookiesallowed_alter(&$callbacks)
- hook_cookiesnotallowed_alter(&$callbacks)
Download
- Log in to post comments