I want remove all cookies ,have any methods provide?
Something like:
for (var c in Cookies.get()) {
Cookies.remove(c);
}
If you鈥檙e able to utilize newer JavaScript features:
Object.keys(Cookies.get()).forEach(Cookies.remove);
Wait, the latter example won't work, the forEach() callback takes more than 1 argument.
This should work:
Object.keys(Cookies.get()).forEach(key => Cookies.remove(key));
path of cookie will be uneffcetive
Most helpful comment
Wait, the latter example won't work, the
forEach()callback takes more than 1 argument.This should work: