You will have noticed by now that when first visiting this website, and many others, you see some kind of notice about the use of web cookies.
If you didn’t know already, cookies are just small text files on your computer that are accessed by the web browser. They have various uses, but as they can be used to gather information about your web activities they are now subject to the EU e-Privacy Directive regulations. In the UK this is implemented by the Information Commissioner’s Office.
Personally I have a lot of reservations about all this. I’m not convinced it deals with underlying privacy issues on the web and the details for compliance look pretty muddled – to say the least! However, I’m not in any way a legal expert and whether we like it or not, all website owners have to do something about this issue.
I apologise for any annoyance that the pop-up may cause, but for most people it will only happen once! Remembering the answer involves using a cookie to record it, which I think is somewhat ironic! For those users who clear their cookies at every session and therefore get the pop-up question every time they visit – I’m really, really sorry!! (but note that our site will still work if you have cookies switched off entirely – and no pop-up)
Although some of the other solutions produce slick-looking, attractive and perhaps less obtrusive implementations, Scott’s script has a number advantages – it is very lightweight, uses no off-site resources and is very simple to implement and customise. I could not see the point of having a fancy graphical effect that most visitors would only see once, but a greater overhead carried by all pages forever!
If you are a website owner/author and interested in the cookie warning script, here are the changes I made:-
- Added a function to test if cookies are enabled in the browser. This stops the pop-up showing if cookies are not allowed anyway.
- Added “path=/” when the cookie is saved, so that pages in sub-directories use the same one.
- Added a 3rd button to the pop-up which links to the Privacy & Security page (no cookies set for this!)
- Changed the greyed-out background to ‘position:fixed’ so it cannot be scrolled.
- Cosmetic changes to the pop-up div.