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);
}
});

Jignesh KumarRank #91 · 22.9K reputationPosted Dec 22, 2021, 5:30 AM EST
Rijwan AnsariRank #82 · 24.2K reputationPosted Dec 23, 2021, 5:14 AM EST
Nirmal DayalRank #1,711 · 886 reputationPosted Dec 22, 2021, 12:14 PM EST
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";
}
}
geetha geethaRank #7,130 · 248 reputationPosted Dec 23, 2021, 2:59 AM EST
RohanRank #1,548 · 1K reputationPosted Dec 23, 2021, 11:17 PM EST