K
kplkumar
Hi
I am doing a manual timeout, irrespective of whether the user is active
or not I will time them out after 3 hours. I also make sure the page is
not cached so that they can't go back to the page from which they were
timedout.
The problem now is that when they go back to their page(which says the
page has expired) and click on the refresh button in the browser they
are somehow authenticated and a new session is created.
I am trying to get them out of them system comepletely and force them
to login again. FYI, I am using integrated "Windows" authentication
mode.
My Global.asax
__________________________________________________________________
void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
HttpSessionState state = HttpContext.Current.Session;
DateTime entryTime =
Convert.ToDateTime(state.Contents["EntryTime"]);
TimeSpan minutes = DateTime.Now.Subtract(entryTime);
if (minutes.TotalMinutes > 180)
{
state.Abandon();
Response.Redirect("http://10.1.1.24:8080/SoapTestWebApp/Timeout.aspx");
}
}
void Application_AcquireRequestState(object sender, EventArgs e)
{
HttpSessionState state = HttpContext.Current.Session;
if (state.Contents["EntryTime"] == null)
{
state.Add("EntryTime", DateTime.Now);
}
}
I am doing a manual timeout, irrespective of whether the user is active
or not I will time them out after 3 hours. I also make sure the page is
not cached so that they can't go back to the page from which they were
timedout.
The problem now is that when they go back to their page(which says the
page has expired) and click on the refresh button in the browser they
are somehow authenticated and a new session is created.
I am trying to get them out of them system comepletely and force them
to login again. FYI, I am using integrated "Windows" authentication
mode.
My Global.asax
__________________________________________________________________
void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
HttpSessionState state = HttpContext.Current.Session;
DateTime entryTime =
Convert.ToDateTime(state.Contents["EntryTime"]);
TimeSpan minutes = DateTime.Now.Subtract(entryTime);
if (minutes.TotalMinutes > 180)
{
state.Abandon();
Response.Redirect("http://10.1.1.24:8080/SoapTestWebApp/Timeout.aspx");
}
}
void Application_AcquireRequestState(object sender, EventArgs e)
{
HttpSessionState state = HttpContext.Current.Session;
if (state.Contents["EntryTime"] == null)
{
state.Add("EntryTime", DateTime.Now);
}
}