Here is the situation:
- User logs in via username/password stored in an MSSQL database
- If the user is authenticated, the system makes a session variable with username/SHA1'd password and boolean if the user is logged in or not (for subsequent pages)
- I need to be able to destroy the session variable. I want a confirmation box as well.
This is what I have so far:
<script type="text/javascript">
//<![CDATA[
function doLogout() {
try {
var conf = false;
conf = confirm("Really log out?");
if (conf === true) {
$.post("logout.aspx");
}
} catch (ex) {
alert(ex);
}
}
//]]>
</script>
Since it is an ajax request won't reload the page (the functionality works fine, the request destroys the session), I think I need a different approach to do this. I would really like to be able to do it all in ASP.NET if possible.
Any solution is welcome, as long as #3 above is fulfilled.