Form Authentication Time Out and Session time Out

Are you using Forms authentication?

Forms authentication uses it own value for timeout (30 min. by default). A forms authentication timeout will send the user to the login page with the session still active. This may look like the behavior your app gives when session times out making it easy to confuse one with the other.

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

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

Setting the forms timeout to something less than the session timeout can give the user a window in which to log back in without losing any session data.

One thing to be aware of when upgrading from ASP.NET V1.1 to V2.0 is that the forms authentication timeout value has changed to be 30 minutes by default.  This means that after 30 minutes of inactivity, a user will be prompted to login again (note: everytime they hit the site the 30 minute window clock gets reset -- so it is only if they are idle that it will timeout). 

If you want to change the timeout value to be longer, you can easily change the timeout value in your local web.config file (the timeout value is in minutes):

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

Hope this helps,



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值