【问题标题】:How to set cookie Timeout less than 1 minute in Forms Authentication ASP.NET?如何在表单身份验证 ASP.NET 中将 cookie 超时设置为小于 1 分钟?
【发布时间】:2016-09-23 16:11:19
【问题描述】:

在asp.net网站表单认证中使用以下配置

<forms loginUrl="login/" timeout="1" slidingExpiration="false" />

超时值只能以分钟为单位设置。

如何将超时时间更改为 20 秒

条件:无需编译代码即可完成

【问题讨论】:

    标签: c# asp.net authentication timeout forms-authentication


    【解决方案1】:

    不,允许的超时是从 1 到 35791374 并且您可以在 web.config 中进行更改,更改将立即反映。

    <configuration>
    <system.web>
     <sessionState mode="InProc" timeout="1">
     </sessionState>
     </system.web>
    </configuration>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-12
      • 2021-05-17
      • 2014-07-13
      • 1970-01-01
      • 2012-09-28
      • 2014-04-01
      • 1970-01-01
      • 2013-09-16
      相关资源
      最近更新 更多