Starting on May 26th 2011 sites for any organisation based within the UK (even if their site is hosted overseas) must seek consent to store cookies on a user's computer, or device. Failure to comply could result in a fine up to £500,000.
A live demo can be seen here, with some extra implementation information.
Who's behind it?
Q. Can I make it so that the prompt box hides when the user accepts cookies on the site?
A. You can use the following chunk of code:
cPrompt.hideOnAccept = true;
Q. Can I make it so that the prompt box is always minimised?
A.You can use the following chunk of code:
cPrompt.minimisePrompt = true;
Q. Is there a shorter & quicker way for me to find out if the user allows cookies?
A.You can use the following method which returns true if the user allows cookies to be stored:
Q. Does this protect me & my site against the law?
cPrompt.cookieLink = 'http://mycookiepolicy.com/me.html';
A. You could revert to a server side fallback, so that you are absolutely definitely covered.
Q. I'm being fined, I'm going to sue you 'cause you got me fined!
A. Well, this is a very dickish thing to do. By you using this you accept that it doesn't necessarily provide full protection & that you will ensure your own site protects you. Even from bears!
Q. This is pretty awesome, can I thank you?
A. Why not watch the code, follow me on Twitter, or simply share this! All of these are a sign of thanks, and make me feel warm & fuzzy inside.