在asp.net C#在服务器端的会话超时 [英] Session timeout on server side in asp.net c#

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

问题描述

我有会话超时问题,甚至我增加code在web.config中,但它不工作如下,过期10分钟之内。

I have problem with session timeout even i added code in web.config as follows but its not working, it expires within 10 mins.

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

服务器有20分钟会话超时。

Server has session timeout of 20 mins.

请帮我解决会话超时问题?

Please help me to solve session timeout issue?

推荐答案

尽管你的服务器有20分钟的会话超时,你提到的。你可能会失去会话状态数据,原因如下:

Despite your Server has session timeout of 20 minutes as you mentioned. you may lost session state data for the following reason:


  • 当IIS应用程序池重新启动或复位。

  • ASP.NET工作进程意外回收。

  • 覆盖你的bin或web.config文件。

  • 或者当你上传或删除应用程序中的任何文件。

解决方法:使用StateServer会话状态模式:

Solution: use StateServer session state mode:

<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="UseCookies" timeout="300" regenerateExpiredSessionId="true" />

访问此链接来配置的StateServer:配置状态服务器来维护会话状态

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

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