Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$.removeCookie is not deleting cookie in Chrome

$.removeCookie is not deleting cookie in Chrome.

Please refer the below attachment of screenshot. The screenshot is taken from the Chrome settings -> All Cookie and site data.

enter image description here

The above screenshot is clearly showing that one cookie(name : !Proxy!proxyJSESSIONID, and path : /stockquote/rest/auth) is available. But when

$.removeCookie('!Proxy!proxyJSESSIONID', { path: '/stockquote/rest/auth'});

code is executed it is returning false and not deleting the cookie.

enter image description here

I am using jQuery Cookie Plugin v1.4.1.

like image 671
Suvonkar Avatar asked Dec 23 '15 11:12

Suvonkar


2 Answers

To delete a cookie with jQuery set the path value to null:

$.removeCookie('filter', { path: '/' });
like image 190
NiallMitch14 Avatar answered Nov 08 '22 07:11

NiallMitch14


To delete cookie, set it's value for null

$.cookie("!Proxy!proxyJSESSIONID", null, { path: '/stockquote/rest/auth' });

And it would be deleted

like image 20
MurDaD Avatar answered Nov 08 '22 07:11

MurDaD