在ASP.NET会话超时 [英] Session timeout in ASP.NET

查看:139
本文介绍了在ASP.NET会话超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行在IIS 6.0中ASP.NET 2.0应用程序。我想会话超时为60分钟,而不是默认的20分钟。我做了以下

I am running an ASP.NET 2.0 application in IIS 6.0. I want session timeout to be 60 minutes rather than the default 20 minutes. I have done the following


  1. 设置
    在web.config中

  2. 设置会话超时在IIS管理器/网络站点属性/ ASP.NET配置设置60分钟

  3. 设置空闲超时在应用程序池属性/性能60分钟。

我仍然在20分钟时获得一个会话超时。还有什么我需要做什么?

I am still getting a session timeout at 20 minutes. Is there anything else I need to do?

推荐答案

您使用窗体身份验证?

Forms身份验证使用它超时自己的价值(30分钟默认情况下)。表单认证超时将用户发送至登录页面与会话仍然活跃。这可能看起来像当会话超时使它容易张冠李戴与其他您的应用程序提供的行为。

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.

这篇关于在ASP.NET会话超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆