Search code examples
asp.netformsforms-authenticationlogout

disable auto logout feature in asp.net


Im using forms authentication. I want my application should not logout the user automatically after sometime.


Solution

  • You can change the timeout like this:

    <system.web>
        <authentication mode="Forms">
              <forms timeout="99999999"/>
        </authentication>
    </system.web>
    

    Further config options can be found here.

    Make sure your session timeout isn't less than the forms authentication timeout. Otherwise, your users will have a hard time using your site.

    You can change the session timeout in the web.config:

    <system.web> 
        <sessionState timeout="999999999" /> 
    <system.web> 
    

    Further details can be found here.

    It could be a security issue to have someone logged in indefinitely.