How can I block cookies for beeing stored in the browser in Angular?

ぃ、小莉子 提交于 2021-02-10 14:51:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!