如何在 web.config 中设置会话超时 [英] How to set session timeout in web.config

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

问题描述

我已经非常努力地尝试,但找不到有关如何为 ASP.Net Web 应用程序的进程内会话设置会话超时值的解决方案.

I have tried very hard but cannot find a solution on how to set session timeout value for in-process session for an ASP.Net web application.

我使用的是 VSTS 2008 + .Net 3.5 + C#.下面是我自己写的设置超时时间为1分钟,对吗?

I am using VSTS 2008 + .Net 3.5 + C#. Here is what I wrote by myself to set timeout to be 1 minute, is it correct?

我在 web.config

<sessionState timeout="1" mode="InProc" />

推荐答案

如果您想将超时设置为 20 分钟,请使用以下内容:

If you want to set the timeout to 20 minutes, use something like this:

    <configuration>
      <system.web>
         <sessionState timeout="20"></sessionState>
      </system.web>
    </configuration>

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

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