I am using this function to set cookies
function setCookie(name,value,days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
setCookie("test_cookie", "test_value", 1);
I found different ways here to delete a cookie but none of them worked for me. As example, I unsuccessfully tried this :
document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
I tried this code on both Firefox and chrome. The cookie remain on the browser after changing the expires
value, Do you have an idea about the problem?