Clear cookie via jquery?
Question by SOLDIER-OF-FORTUNE
I have a DNN installation but one of the portals is broken and the “logout” button doesnt seem to clear the cokoie. Is it possible to use jquery to clear a specific cookie? or a seperate ASP.NET page?
Answer by Starx
Sure, Using cookie plugin like this
$.cookie("name", null);
Update:
if($('a[href="webiste.co.uk/en-gb/admin.aspx"]').length) {
$.cookie("name", null);
}
Update 2: Pure Js
function deleteCookie(name) {
document.cookie = name+'="";-1; path=/';
}
var login = document.getElementById("loginlink");
login.onclick = function() {
deleteCookie("name");
};