简体   繁体   中英

Browser addon to automatically opt-in for cookies - EU cookie law

In EU we have this law that requires web pages to request permission to store cookies. Most of us know about cookies and agree to them but still are forced to accept them explicitly everywhere. So I plan to write this add on (ff & chrome) that will automatically add session cookie with standard name that would mean agreement. Just wondering about few things:

1) What should be the name of the cookie? What should be the value? Should I cover only user agreement option? My proposition is _cookieok=1 the benefit is that it is short, yet descriptive.

2) Should I add only single cookie - the one I suggested above? Many pages do it in different ways already. They use different cookie names and check for different values. I thought maybe use names and values from popular scripts like http://cookiecuttr.com/ but I don't want to increase upload traffic with a number of mostly not needed cookies.

3) Should I differentiate between types of cookies? I have seen here http://demo.cookieconsent.silktide.com/ there are multiple cookie types you can opt-in/opt-out?

4) Does this have chances to become popular or is it better to use something like point 2 - adding multiple values manually?

5) I could probably also remove those cookies after some event (like after all js onload functions have finished) but I could not find proper hook in firefox addons. Plus maybe some people would like to do filtering out of the script on server side so maybe it is better to keep sending the cookie.

Is there something I have not thought about? My suggested code is in case of FF:

var pageMod = require("sdk/page-mod");
pageMod.PageMod({
    include: "*",
    contentScriptWhen: 'start',
    contentScript: 'document.cookie="_cookieok=1;path=/";'
});

Update

To explain how does it work 1) Most sites already compliant to cookie law do something like this:

if ($.cookie('_cookieok') == null) {
    $('#cookie-close').on('click', function (evt) {
        $.cookie('cookieok', 1, 300); 
    });
    $('.cookie-prompt').show();
}

so if we agree on same name existance of such ff plugin would be possible. If someone does not plugin - site will prompt him. If has site would recognize addon added cookie as their own.

Not too sure what the point of this really is to be honest?

If you're looking to build something that would be used across a portfolio of sites you manage, then you're probably pushing your luck to force a user to install an extension simply to show they accept your cookies. If it's aimed at a wider audience, ie potentially anyone using any website, then the other issue you'll have is getting both users to see the benefit of installing another extension and secondly website operators to write the code necessary to detect your cookie and act accordingly.

Most sites seem to be striving to make cookies and the associated obligations under the legislation as unintrusive as possible - requiring installation of an extension & changes to website code seems to be heading in the opposite direction..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM