InProc会话超时不起作用 [英] InProc session timeout not working

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

问题描述

我正在使用asp .NET MVC应用程序,并且已经配置

I'm using asp .NET MVC app, and I've configured

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

但是看起来会话仍然只在20分钟而不是90分钟内有效,为什么?

but It looks like session still valid only 20 minutes instead of 90, why?

如何使它有效,而不是20(我想是默认值)

How can I make this effective instead of the 20 (default I suppose)

我检查了应用程序池中的空闲时间,它是20,这是造成超时的原因吗?如果是,如何从配置文件中覆盖它?

I've checked te idle time in the application pool, it was 20, is that the cause of the timout? If yes, how can I override this from config file?

推荐答案

由于IIS每隔x分钟重新启动池(包括会话),因此没有任何活动,这是由池本身设置中的空闲超时配置的,如果用户在应用程序中设置了90分钟的会话,如果没有活动,则IIS可以在这90分钟结束之前重新启动池.示例:

Because IIS restart the pool (including sessions) each x minutes with no activity, configured by the idle timeout in the settings of the pool itself, in the case if user set 90 minutes of session in the app, if there is no activity, IIS can restart the pool before this 90 minutes ends. Example:

会话是60分钟,在app.config中配置 闲置30分钟后,泳池会自行回收 只有一个人使用该应用程序

Session is 60 minutes configures in app.config after 30 minutes of idle, the pool recycle itself Only one person use the app

1.00pm:用户连接,他在10分钟内导航,然后在页面上不执行任何操作(因为instacne无需提交,也没有ajax调用即可填写非常大的表格.此时,用户处于打开"状态,直到1.00am + 10分钟+配置的60分钟=上午2.10 凌晨1.50,他尝试按提交"按钮,但由于应用程序池在1.40(1.10 + 30分钟的空闲时间)进行回收,因此用户失去了会话,因此无法正常工作.

1.00pm: user connects, he navigates during 10 minutes and then do nothing on the page (for instacne fill a very large form without submitting, and without ajax calls. At this point, user has session "open" untill 1.00am + 10 minutes + 60 minutes configured = 2.10 am At 1.50 am, he tried to press submit button but it doesn't work because the app pool was recycling at 1.40 (1.10 + 30 min of idle) so user lost session.

如果有可能是用户在应用程序上烦恼,则空闲时间必须大于会话时间.

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

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