Jun 29, 2009 03:42 AM|meetmanthan|LINK
In Golobal.asax file there is twp methods call
void Session_Start(object sender, EventArgs e)
// Code that runs when a new session is started
void Session_End(object sender, EventArgs e)
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
In these method you can handle ur code to redirect user to login page. In session start event you can check weather session is expire or not. if it is expire then you can redirect user to login page. where user get authenticed and works for it.
you can do one thing that on every page check wearther session is expire or not like follwoing method as i have written.
protected void CheckUserLogin()
if (Session["userid"] == null)
Response.Redirect("Login.aspx?returnUrl=" + Server.UrlEncode(Request.RawUrl.ToString()));
Which checks weather user's session is expire or not if it is then it is clearing session and cookies and redirect user to login page.