MVC会员资格套件问题

时间:2009-08-12 18:50:41

标签: asp.net asp.net-mvc asp.net-membership

我使用该套件可以正常运行我的网站。

我的问题是,当您点击复选框以保持登录状态时,他们是一种延长登录时间的方法。我的客户想要一个小时。

2 个答案:

答案 0 :(得分:2)

尝试在web.config中增加authentication/forms/timeout值:

<authentication mode="Forms">
    <forms loginUrl="~/Account/LogOn" timeout="60"/>
</authentication>

From MSDN

  

指定cookie过期的时间(以整数分钟为单位)。 ...默认值为“30”(30分钟)。

答案 1 :(得分:1)

是的,你在web.config

中的表格超时中设置了这个
    <authentication mode="Forms">
       <forms loginUrl="~/Account/LogOn" timeout="2880"/>
    </authentication>

目前设定为48小时(2880/60)。

如果您想要一小时,请将其更改为60。虽然,更长的时间会更合适。