I am in Session_End() of Global.asax.cs
There is an operation I need to do only if the session was ended on a specific page. The parameters (sender and eventArgs) are not of any help. Is there a way to figure out last page the user was on?
Thanks in advance.
You can probably use
HttpContext.Requestproperty but not sure whether that will still be valid after session expire.In such case, you need to explicitly write the page URL in cookies every time user request a new page. That way, even though session expires you can check the cookie object and see what was the last requested page.
General scenario, once session expires end user should be re-authenticating himself and thus you should redirect to login page directly and if you are using
Forms Authenticationthen you can just sayFormsAuthentication.RedirectToLoginPage();