如何配置ASP.NET Web应用程序的超时? [英] How to configure the timeout of your ASP.NET web application?

查看:49
本文介绍了如何配置ASP.NET Web应用程序的超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前对ASP.NET Web应用程序的经验(关于超时)是,无论运行什么模块,它每30分钟注销一次用户,是否有一种方法可以将应用程序超时增加到一两个小时?

My previous experience with ASP.NET web application (regarding the timeout) is that it logouts the user every 30 minutes, regardless of what module is running, Is there a way that we can increase the application timeout to an hour or two?

非常感谢您提供任何帮助.

Any help is highly appreciated, thanks in advance.

推荐答案

您可以在web.config文件中设置Sesion超时.

You can set the Sesion timeout in your web.config file.

<sessionState timeout="60" />

该值以分钟为单位定义.

The value is defined in minutes.

我认为您也可以通过HttpContext.Current.Session对象以编程方式进行设置.

I think you can set it programmatically as well from the HttpContext.Current.Session object.

这篇关于如何配置ASP.NET Web应用程序的超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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