Hello everyone I have use this code for clear cookies but cookies not clear.
$(document).ready(function () {
var contactUs=localStorage.getItem("");
if(contactUs=="true")
{
localStorage.removeItem("contact");
setTimeout(function () {
debugger
$.removeCookie("AspNetCore.Identity.Application");
window.location = "";
}, 10000);
}
});
RohanPosted Dec 24, 2021, 4:17 AM
Rijwan AnsariPosted Dec 23, 2021, 10:14 AM
geetha geethaPosted Dec 23, 2021, 7:59 AM
Nirmal DayalPosted Dec 22, 2021, 5:14 PM
Hi Rohan,
Here to find the all cookies and set expires time..
function deleteAllCookies() {
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i];
var eqPos = cookie.indexOf("=");
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
}
}
Jignesh KumarPosted Dec 22, 2021, 10:30 AM