Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences in forms auth timeout and session timeout

The session state timeout is set using this web.config element

<sessionState mode="InProc" cookieless="false" timeout="120" /> 

The forms auth is configured using this web.config element

<system.web>   <authentication mode="Forms">     <forms loginUrl="Login.aspx"            protection="All"            timeout="30"            name=".ASPXAUTH"             path="/"            requireSSL="false"            slidingExpiration="true"            defaultUrl="default.aspx"            cookieless="UseDeviceProfile"            enableCrossAppRedirects="false" />   </authentication> </system.web> 

What is the difference between the timeouts specified in each of these elements? If both are different, how would it work?

like image 880
Nick Avatar asked Feb 01 '10 16:02

Nick


People also ask

What is session timeout?

Session timeout represents the event occuring when a user does not perform any action on a web site during an interval (defined by a web server). The event, on the server side, changes the status of the user session to 'invalid' (ie.

Why do forms time out?

Now, why is this necessary.. Forms authentication timeout indicates, how long a user is recognised and stay authenticated in case of any lack of inactivity and similarly session timeout indicates how long to preseve users session in case of any inactivity.

What is the default timeout for session?

The default is 10 minutes. Session. Timeout has no hard-coded limit. Most Web administrators set this property to 8 minutes.

What is authentication mode forms?

Forms authentication enables user and password validation for Web applications that do not require Windows authentication. With forms authentication, user information is stored in an external data source, such as a Membership database, or in the configuration file for an application.


1 Answers

A session starts every time a new user hits the website, regardless of whether or not they are anonymous. Authentication has very little to do with Session.

Authentication timeout is the amount of time that the authentication cookie is good for on the user's browser. Once the cookie expires, they must re-authenticate to access protected resources on the site.

So, if Session times out before the Authentication cookie - they are still authenticated, but all their session variables disappear, and may cause errors in your website if you are not disciplined in checking for nulls and other conditions brought about by missing session.

If Authentication times out before the session, then all their session variables will still exist, but they won't be able to access protected resources until they log back in again.

like image 104
womp Avatar answered Sep 20 '22 10:09

womp