I have a login link that fires a javascript function that calls a logout page. This is what the logout page consists of:
If Response.Cookies.Count > 0 Then
Response.Cookies("aLog").Value = Nothing
Response.Cookies.Clear()
End If
Originally I just had cookies.clear in there, but that wasn't working.
Here is the javascript that send the request to the logout page:
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$('#logout-link').click(function() {
if (confirm("Really log out?")) {
$.cookie('aLog', null);
location.href = $(this).attr('href');
}
return false;
});
});
//]]>
</script>
The jQuery function $.cookie
does not work either. The cookie is set by ASP.NET, so I figured I could unset it with ASP.NET too but apparently not. Any ideas/suggestions?
However, the bad cookies that malware scanners can detect and remove want to try and steal your personal information. If bad cookies keep making their way back onto your company computer after a scanner removes them, it is because your Web browsing keeps inviting the cookie back.
Click the upper-right hamburger stack and select Options > Privacy & Security. Under Cookies and Site Data, click Clear Data > Cookies and Site Data > Clear to remove your entire cookie history. Back to Cookies and Site Data, select Manage Data if you want to choose the sites from which to remove cookies.
… on your Android deviceGo to the “Settings” menu. Look for “Privacy & security” and select “Clear private data.” Select “Cookies & active logins.” After you have made your selection, tap “Clear data.”
Settings. Clear browsing data. Choose a time range, like Last hour or All time. Check Cookies and site data and uncheck all other items.
Working with cookies in ASP.NET can be a little un-intuitive. To kill a cookie that already lives on the client-side, you have to set its expiration date to sometime in the past, and re-send the client the new cookie. The client browser will update the existing cookie with the new expiration date, and then immediately kill it since it has already passed the expiration date:
HttpCookie cookie = Request.Cookies["aLog"];
cookie.Expires = DateTime.Now.AddYears(-10);
Response.AppendCookie(cookie);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With