Page Redirect when session end in ASP.Net MVC
- by Kaung Sitt Thu
I would like to do redirect to login when current session end and that config must be working at any View and Controller.
///My current code in Global.asax
protected void Session_End(object sender, EventArgs e)
{
Session.Abandon();
//GetPath() is getting currently path
// eg. http://localhost/mymvcproject
Response.Redirect(PATH.GetPath() + "User/LogOn");
}