Allow special strictly necessary cookies
According to GDPR, strictly necessary cookies could be set in case they are required for the 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 allows you to assign those cookies to a Strictly necessary cookie category. However, in some cases, those cookies do not have fixed names.
Cookie-Script now allows you to list those cookies and they will not be deleted when the page loads (before the user agreed to Cookie Policy). This option can be found in the Behaviour tab > Strictly necessary cookies list.
Note: Cookies listed in this section will not be shown in the cookie declaration table.
Simply list all your functional cookies comma separated, for example:
_gid,sid,session
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 the regular expression.
Here is an example of the 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:
- cookie named cart
- cookie with any name that has 32 symbols of 0-9 and a-f (hash-like value)
- cookie named language
You can use this regular expression to keep hash-like cookie names: /^[a-f0-9]{32}$/i
For other types of randomly generated cookie names, you can build your own regular expressions.