【问题标题】:How to maintain session timeout when user is inactive for 3 minutes in asp.net application [closed]当用户在asp.net应用程序中不活动3分钟时如何保持会话超时[关闭]
【发布时间】:2013-11-21 13:04:31
【问题描述】:

我想实现会话超时 3 分钟。会话的实际工作方式是当用户空闲 3 分钟然后只有用户注销或会话过期。

但是会话在我的 asp.net 应用程序中的工作方式,当用户也处于活动状态 3 分钟时会话到期。

我想知道如何正确处理会话。 我的代码示例在这里

<authentication mode="Forms">
<forms loginUrl="~/Login/LoginFrist.aspx" timeout="5" />
</authentication>

【问题讨论】:

  • 你设置了滑动过期时间吗?

标签: c# asp.net session


【解决方案1】:
<system.web>
    <authentication mode="Forms" >
      <forms slidingExpiration="true" timeout="3"></forms>
    </authentication>
  </system.web>

将其放入您的 web.config 或相应更新。

查看以下内容了解更多详情

Forms authentication timeout vs sessionState timeout

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-07
    • 2014-12-22
    • 1970-01-01
    • 2015-10-20
    • 2015-05-22
    • 2023-04-11
    相关资源
    最近更新 更多