newbie question: timeout

  • Thread starter Thread starter Dave Bartlett
  • Start date Start date
D

Dave Bartlett

We have a site which requires a user to login. Often users want to login,
then do nothing on our site for a few hours, then use it again, eg. have the
browser minimised.
When they try to use the site after a period of inactivity, they see a
fairly ugly error message from the server.

How do I:
1) Change the timeout to say 5 hours
2) Prevent the user seeing the error page, and instead redirect them to the
login page?

Thanks
 
Hi Dave,

You can set the timeout for the session in the web.config

<configuration>
<system.web>
<sessionState mode="Inproc"
cookieless="false"
timeout="300"/>
</sessionState>
</system.web>
</configuration>

For the login, try this...

<authentication mode="Forms">
<forms name=".MYLOGIN" loginUrl="login.aspx" protection="All" path="/"
timeout="300" />
</authentication>

http://msdn.microsoft.com/library/d...en-us/cpgenref/html/gngrfsystemwebelement.asp
 
Back
Top