All instructions about how to set up Cookie-Script properly

Allow strictly necessary cookies

According to GDPR, strictly necessary cookies could be set in case they are required for website to work properly. Also, not all cookies are considered private data, for example a cookie to store visitor setting on the website, language or cart can be set without user consent.

Cookie-Script now allows you to list those cookies and they will not be deleted when page loads (before user agreed to Cookie Policy). A new option is implemented for that: Functional cookies

Simply list all your functional cookies comma separated, for example: 



Regular expression usage

Some systems session cookies do not have a certain name, instead cookie names are generated randomly, like a hash value, ex: 3c70b445f566758848ec319708ce2e05 (32 symbols of alphanumeric characters).

For that we have implemented regular expression match functionality, which means you can use a regular expression for cookie name and Cookie-Script will also not delete any cookies that match regular expression.

Here is an example of same "Functional cookies" option in this case:

cart, /^[a-f0-9]{32}$/i, language

In this example 3 cookies are considered strictly necessary and will not be deleted by Cookie-Script:

  1. cookie named cart
  2. cookie with any name that has 32 symbols of 0-9 and a-f (hash-like value)
  3. cookie named language

You can use this regular expression to keep hash-like cookie names: /^[a-f0-9]{32}$/i

For other types of random generated cookie names you can build your own regular expressions.

Note: Regular expression has to start with a "/" symbol