问题
I'm currently building a little angular page. In this page I'm using ngx-cookieconsent
(https://www.npmjs.com/package/ngx-cookieconsent) for handling the cookies.
Everything works but now I'm a little bit confused. I've set it up with the parameter opt-in
but when I visit the page first, there are already cookies stored in the browser even if I press decline or nothing:
Thats really confusing. I've also tried subscribing to the status change of the consent:
this.statusChangeSubscription = this.ccService.statusChange$.subscribe(
(event: NgcStatusChangeEvent) => {
console.log('Changed');
});
But I still don't know why there are cookies before and how I can block them again if the user presses the decline button.
Does anyone can explain this please?
来源:https://stackoverflow.com/questions/61656421/how-can-i-block-cookies-for-beeing-stored-in-the-browser-in-angular