Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable auto logout feature in asp.net

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

like image 926
hotcoder Avatar asked Oct 01 '10 13:10

hotcoder


2 Answers

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.

like image 167
Joe Ratzer Avatar answered Oct 18 '22 00:10

Joe Ratzer


I don't know if you can turn it off completely, but you could try setting a large timeout value in your web config:

    <authentication mode="Forms">
        <forms loginUrl="Login.aspx" timeout="9999" slidingExpiration="true" defaultUrl="~/Default.aspx"/>
    </authentication>
like image 4
Brissles Avatar answered Oct 18 '22 00:10

Brissles