开发者

disable auto logout feature in asp.net

Im using forms authen开发者_开发技巧tication. I want my application should not logout the user automatically after sometime.


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.


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜