orestbida / cookieconsent

:cookie: Simple cross-browser cookie-consent plugin written in vanilla js

Home Page:https://playground.cookieconsent.orestbida.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: impossible to delete cookies from subdomain

jacksoggetto opened this issue · comments

Expected Behavior

If a cookie is added, I should be able to go on a subdomain and delete it.
for example in my case I have the main WordPress webisite on the main domain.
Then I have my.domain.tld for the client area with a different software.

Seems logical to me that the user that approved the cookie on the main domain (and using .domain.tld ad domain and / as path) should be able to revoke his consent from the subdomain, and it should work

Current Behavior

cookies are deleted only if they are set as my.domain.tld
.domain.tld are not deleted from the subdomain

Steps to reproduce

here is my json, not sure what to add. I'm using the json here: https://cookieconsent.orestbida.com/essential/getting-started.html -> fully featured example with a couple small edits:

analytics: { autoClear: { cookies: [ // { // name: /^_ga/, // regex: match all cookies starting with '_ga' // domain: '.domain.com' // }, { name: '_ga', // string: exact cookie name domain: '.domain.com' } ] }, },
the domain of course I used my domain.
I also added my domain in the same format in the cookie table.

Proposed fix or additional info.

in the latest version I was able to edit the code, but I'm not familiar with your new code, so I have none.

Version

3.0.1

On which browser do you see the issue?

Chrome

My bad, the problem was I was using
domain: '.domain.com'
instead of
domain: 'domain.com'