Disable and enable cookies

Hi,

There is a “disableCookies” function in the Piwik tracker API, is there an “enableCookies”?

Thanks!

Hi,

A quick look into piwik.js shows that the answer is apparently no.

What exactly would you need the function for? By default cookies are enabled, so this should only be needed if you want to reenable cookies on the same page after disabling them.

That’s exactly the use case. We have folks who come into our client’s webpages and they want cookies disabled by default, then allowing the user to enable cookies optionally (per local compliance laws & GDPR)

Sounds like a good idea, so I made a feature request here:

Unless your website is a SPA, you could of couse stop calling disableCookies, which I think should start creating the cookies on the next page load.

Thanks! (It is an SPA)