Issue with asp.net timeout value.

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
Hi all

I have set the timeout value of my web app to 2 minutes in to web.config file. I have also confirmed that the session timeout for the app. in IIS is also set to 2 minutes. I am only using the 2 minutes as a test and will up the value to about 20 minutes when I get it working properly.

So, I log in, and I do nothing for over two minutes. When I try to go to another page via the menu control, the application starts crashing and throws errors regarding missing data, tables, etc. Now I think that this is due to the fact that I previously changed the Content Expiry to 2 minutes and then to 4 minutes.

How can I get my app. to redirect the user to the long in page after a set time?

Mike55.
 
Have a look at the IHttpModule interface. You can intercept the page request at its earliest possible state. From there you check the Session for a particular variable. If the Session has timed out this variable will not exist and you can simply redirect them to your login page -- where you will set the variable into Session after a successful login. You can also do this type of thing in the global.asax file but the IHttpModule approach provides more options.
 
Back
Top