Hi, i with jquery delete cookies
$.cookie('name', '', { expires: -1 });
refresh page and still cookies is in browser (memory),
alert('name:' +$.cookie('name'));
show name: Gloris
. Why? Thanks
Hi, i with jquery delete cookies
$.cookie('name', '', { expires: -1 });
refresh page and still cookies is in browser (memory),
alert('name:' +$.cookie('name'));
show name: Gloris
. Why? Thanks
You are deleting a cookie titled 'name' and alerting a cookie titled 'the_cookie'.
To delete a cookie with JQuery, set the value to null:
$.cookie("name", null);
Edit: The final solution was to explicitly specify the path
property whenever accessing the cookie, because the OP accesses the cookie from multiple pages in different directories, and thus the default paths were different (this was not described in the original question). The solution was discovered in discussion below, which explains why this answer was accepted - despite not being correct.
As in the documentation here, what you ar edoing is how to do what you wanna achieve, the problem must be some other place, probably the cookie is being set again somehow on refresh.