I want to sign out a user when his session times out. So used following code in Global.asax:
protected void Session_End(object sender, EventArgs e)
{
For
Are you sure that it never fires ?
As I understand it Session_End
has nothing to do with the current request because ASP.NET session is terminated by the timeout AFTER the last request from the client has arrived. The call to FormsAuthenticaion.SignOut
manipulates authentication cookies and therefore has no effect without any connectivity from the client (browser).
Take a look at this question (which has an answer) - the problem is more or less similar to yours so you might find a right solution:
Session_End in Global.asax.cs not firing using forms authentication
Hope this helps.