The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Pure JS Help with Cookie Tool Re: Pure JS Help with Cookie Tool



I only set the cookie, I did not add the code for checking it –

shows how to write, delete and check for cookie.

is your original, with the added functionality to test if the cookie is present or not (and lets you delete it)

For EU compliance you would need to list each cookie by name and originator and state what the cookie is used for. This can be done in your privacy or cookie policy, but you must link to that information from the accept cookies box.

The accept button must be shown before any cookies are set on the site, so every cookie that is being written via your site must have some code around it to only write it if the ‘accept-cookies’ cookie is set.

You must also have a simple and obvious way for people to change their mind and stop accepting cookies. is a potential solution I am working on for the Joomla CMS – still needs a little work for full compliance though.

Because of the complexities of the law there are no quick and easy solutions, other than don’t write cookies, or use any other code on your site that sets cookies.

It is a nice idea to have a ‘drop-in’ solution for this, but I think you would needs to put loads of caveats with your solution – and tutorials, code examples, etc. on how to ‘find and isolate’ each cookie (is it set with js or php for instance).

I don’t want to put you off, but if you are going to release this as a solution to the EU directive then you need to think carefully about who you are releasing it to (coders, content managers, site owner who just copy/pastes) and make sure you do not offer any compliance guarantees, either explicitly or implied.

Good luck,