How to remove all cookies in Angularjs?

后端 未结 2 1479
情歌与酒
情歌与酒 2020-12-14 17:45

I can set a cookie like this:

$cookieStore.put(\'myCookie\',\'I am a cookie\');

And I can remove it with

$cookieStore.remov         


        
2条回答
  •  忘掉有多难
    2020-12-14 18:37

    In case you are on this page and you working on an old project that uses angular 1.3.x or less, you can simply use this

    $cookies.cookieKey = undefined;
    delete $cookies['cookieKey'];
    

提交回复
热议问题