I have two questions. I will split my questions into two sections and give an overview. I'm not entirely sure of the code I need to post so if I have missed some out, please let me know and I will help.
Overview:
When the browser is closed I need to sign the user out.
Question 1:
How do I call Session_End when the browser is closed?
I did some reading on how to close it and it seems that the only way to detect if a Session has ended when a browser has been ended is by using something called 'InProc' in my web config. I gave it an attempt and it didn't seem to change anything at all. So I'm wondering if there is another way around this.
Session_End:
protected void Session_End() {
if (User.Identity.IsAuthenticated) {
}
}
Question 2: How to sign a user out on Session_End?
Once the program has called the void I need to sign the user out as it's causing a bug in my program. I am using the Authentification manager.
Session_End:
protected void Session_End() {
if (User.Identity.IsAuthenticated) {
AuthenticationManager.SignOut();
}
}