I need to redirect the user to the login page on session timeout. The issues with Session_End method in the global.asax are:
- It does not support Response.Redirect or Server.Transfer
- Any attempt to use HttpContext.Current.Response results in 'Object Reference not set to an instance of an object' error
What I want to know is whether is it possible to redirect the user directly (and specifically) from session_end to another page. There are methods which work (not using the session_end method), but all of them require a request to the server(such as a refresh,which I don't want). Can i do this without using javascript?(more important, should I?)
Thanks in advance!
Isn't Session_End raised directly on server, without any interaction from user?
What happens, when I go to your page (and start a session), close browser window and never return? Then it's understandable, that
HttpContext.Current.Responseis null.