如何增加表单身份验证中的超时时间
问题描述:
我对表单身份验证有些疑问。如何增加asp.net网站中表单身份验证的超时时间?在我的网站上,我设置了<forms loginUrl="Default.aspx" name=".ASPXAUTH" timeout="60000" protection="All">
。但是如果我们在15分钟后刷新页面,它将重定向到默认页面。你可以建议我任何一个,如何解决这个问题。如何增加表单身份验证中的超时时间
在此先感谢!
答
如果要更改超时值是更长的时间,你可以很容易地在当地web.config文件更改超时值(超时值以分钟为单位):
<system.web>
<authentication mode="Forms">
<forms timeout="50000000"/>
</authentication>
</system.web>
答
尝试这样的:
<authentication mode="Forms">
<forms loginUrl="~/Auth/SignOn.aspx" timeout="40" slidingExpiration="true" />
</authentication>
在一个侧面说明,你应该让TimeOut(Session) less than or equal to TimeOut(FormsAuthentication) * 2
是这个问题?或者你只是想增加表单的时间跨度。正确澄清它 – BNN 2015-03-31 11:00:57