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?