2

I loaded jquery cookie from http://cdn.jsdelivr.net/jquery.cookie/1.3.1/jquery.cookie.js .

But I tried

$.cookie()
Object {IntApp_prpl1115: "soapB9ACC84D2F8F9F15B110049BBA948D37&iwk OVEoOoMWr….161:8081/nexus/index.html&projects.projecta&true", IntApp_prpl1114: "soap7C84F0E730125B1D892B2A089A2B6D17&X-URTfgwdrvy3….161:8081/nexus/index.html&projects.project1&true"}
IntApp_prpl1114: "soap7C84F0E730125B1D892B2A089A2B6D17&X-URTfgwdrvy3VhUTh7W 3Mt.tf&http://10.2.0.161:8081/nexus/index.html&projects.project1&true"
IntApp_prpl1115: "soapB9ACC84D2F8F9F15B110049BBA948D37&iwk OVEoOoMWr hckhlvMAMb.tf&http://10.2.0.161:8081/nexus/index.html&projects.projecta&true"
__proto__: Object


$.cookie("IntApp_prpl1115")
"soapB9ACC84D2F8F9F15B110049BBA948D37&iwk OVEoOoMWr hckhlvMAMb.tf&http://10.2.0.161:8081/nexus/index.html&projects.projecta&true"


$.removeCookie("IntApp_prpl1115")
true


$.cookie("IntApp_prpl1115")
"soapB9ACC84D2F8F9F15B110049BBA948D37&iwk OVEoOoMWr hckhlvMAMb.tf&http://10.2.0.161:8081/nexus/index.html&projects.projecta&true"

Why is cookie remove not working ? I even went and saw in chrome://settings/cookies that the cookie was not deleted .

I refered this how to delete cookie in jquery at the time of browser closing? . but still I am getting cookie value even after remove operation .I referred also http://www.sitepoint.com/eat-those-cookies-with-jquery/ .

UPDATE based on looking at source : Is there anything like cookie delete completely ? Or does it only change expiry time ? In code it seems like they are changing expire to some unreachable time . Am I right ?

why why cookie delete (wipe out completely the name value pair) feature is not provided . I think it is not available even in java script . But in chrome ui we can do it in chrome://settings/cookies

Why is it so ?

Community
  • 1
  • 1
Harish Kayarohanam
  • 3,886
  • 4
  • 31
  • 55

1 Answers1

0

You can delete by setting cookie's expiry date to past

document.cookie = cookiename + "=" + cookievalue + ";expires=" + new Date().setDate(new Date().getDate() -1);

(OR)

$.cookie('cookiename', 'cookievalue', { path: '/', expires: -1 });