forkcms/forkcms — pull request #491 by tijsverkoyen (2013-05-17 11:38:52+00:00)
Title: Implementation of the cookie law

There is a lot of discussion about the European Cookie Law. Where each country has his own implementation it isn't that easy to find a way to handle them based on the country, because it doesn't only depend on the country per user, it depends on who you target.

Therefore I implemented the most strict cookie law, which should fullfill for all countries.

## How it works
A cookie bar is available in the template (you should include it in your theme). The cookie bar is visible the first time a visitor enters the website, when he hasn't a *functional* cookie set to hide the bar.

When the visitor hasn't a cookie (`cookie_bar_agree`) set all tracking is disabled and the data send to Google Analytics is [anonymised](https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApi_gat?hl=nl#_gat._anonymizeIp).

When a user clicks he *disagrees* a *functional* cookie is set to hide the cookie bar, and a cookie (`cookie_bar_agree`) is set to `false`. The cookie bar will be invisible from then on. When this happens no tracking is don, and the data for Google Analytics is anonymised.

When a user clicks he *agrees* the same the cookie for hiding the bar is also set, and the `cookie_bar_agree`-cookie is set to `true`. From then on the cookie bar will be invisible, the Fork-tracking is enabled and the data for Google Analytics isn't anonymised.

## Consequences
* The first visit of a user will always be anonymized.
* If a visitor doesn't allow cookies, the visitor will be unique for each request.

## CommonCookie::hasAllowedCookies()
This method returns if a visitor has allowed the usage of cookies. If you are using tracking-cookies in your own code, you should use this method to check if it is allowed.

## Todo
* The copy of the message should be translated in all available languages
* Check the copy with a lawyer.