Not sure if this is a good test, but I executed this project in vs2010 on my workstation. I then fast forward my clock to an hour later. When I try to navigate, I then get the error: "HttpException was unhandled by user code: response is not available in
this context". Is this a good test? If so, why am I getting this error. I have googled many methods on how to do this but none have worked.
caolong
Member
5 Points
31 Posts
Redirect to custom session expire page
Jan 17, 2013 03:48 PM|LINK
Hi,
My default timeout is set to 20min. I have this code below in my global.asax.
void Session_OnEnd(object sender, EventArgs e) { Response.Redirect("SessionExpired.aspx"); }Not sure if this is a good test, but I executed this project in vs2010 on my workstation. I then fast forward my clock to an hour later. When I try to navigate, I then get the error: "HttpException was unhandled by user code: response is not available in this context". Is this a good test? If so, why am I getting this error. I have googled many methods on how to do this but none have worked.
Thanks
Ruchira
All-Star
43050 Points
7036 Posts
MVP
Re: Redirect to custom session expire page
Jan 19, 2013 12:04 PM|LINK
Hello,
Then your session is already ended so any requests after that would be invalid.
If you need to check the Session_OnEnd event, you can set the clock to about 15 minutes ahead and wait for 5 minutes to get it fired.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.