I am having weird issue with IE10. IE10 is sending expired JSESSIONID cookie for authentication causing the login filure, So am trying to delete the JSESSIONID cookie as below
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) != -1) {
return c.substring(name.length, c.length);
}
}
return "";
}
if(getCookie("JSESSIONID"))
{
var c = getCookie("JSESSIONID")
console.log("JSESSIONID = "+ c)
document.cookie = c + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}
Whenever I reload the page I see JSESSIONID = A64F97BF3AF662AC56238F2C23D529AA
in the console log
instead of JSESSIONID = A64F97BF3AF662AC56238F2C23D529AA=; expires=Thu, 01 Jan 1970 00:00:01 GMT;
Can someone please help me to fix this issue?