Js-cookie: Remove all cookies on One operation

Created on 4 Feb 2016  路  3Comments  路  Source: js-cookie/js-cookie

Something about Cookies.removeAll(); to clear cookies.

Most helpful comment

Also, if you don't want to import a new module, you could simply use something like this in your own side:

Object.keys(Cookies.get()).forEach(function(cookie) {
  Cookies.remove(cookie, attributes);
});

I don't see the need of having this built-in in the lib, since not everyone has the use case of removing all cookies visible to the current page, that is requirement specific and should be explicit in the application code.

All 3 comments

Also, if you don't want to import a new module, you could simply use something like this in your own side:

Object.keys(Cookies.get()).forEach(function(cookie) {
  Cookies.remove(cookie, attributes);
});

I don't see the need of having this built-in in the lib, since not everyone has the use case of removing all cookies visible to the current page, that is requirement specific and should be explicit in the application code.

I will close for now and consider it as a duplicate, but we can reopen this if you have any new information that might change what we know.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jiangdefu picture jiangdefu  路  3Comments

BonBonSlick picture BonBonSlick  路  9Comments

Daijobou picture Daijobou  路  6Comments

migsyboy picture migsyboy  路  7Comments

FagnerMartinsBrack picture FagnerMartinsBrack  路  9Comments