Skip to content
forked from jasondavis/cPrompt

A simple drop-in JS script that will prompt your users to allow cookies on your site. As per the new EU law released on the 26th May.

Notifications You must be signed in to change notification settings

spiffin/cPrompt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cPrompt

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.

Spiffin fork...

This is a forked version with background images removed and small style changes. Note you need the 'added styles' block of CSS from the index.html file - or the cprompt.css stylesheet.

Demo

A live demo of the original can be seen here, with some extra implementation information.

.. and a live demo of the fork is here.

Who's behind it?

FAQs

new 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;

new 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;

new 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:

cPrompt.allowCookies()

Q. Does this protect me & my site against the law?
A. The requisites of every site differ, this is only a javascript solution, the cookie that is set can be accessed in server side code. If using this code, you need to ensure that it covers your site, however every effort has been taken to try to make this as compliant as possible.

Q. Can I set a 'Cookie Policy' URL for my visitors to read? I hear the law stipulates that I should have one.
A. You can use the following chunk of code to set a cookie policy URL that will appear in the prompts:

cPrompt.cookieLink = 'http://mycookiepolicy.com/me.html';

Q. What if the user has javascript disabled?
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.

About

A simple drop-in JS script that will prompt your users to allow cookies on your site. As per the new EU law released on the 26th May.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%