我的会话在5到10秒内到期 [英] My session expires within 5 - 10 seconds

查看:86
本文介绍了我的会话在5到10秒内到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VS 2008作为我的应用程序。



本地代码工作正常

但是现场会话在5到10秒内到期

请帮助



我的尝试:



我已经尝试了所有的做法来增加会话时间。



使用sessionState增加Web配置

也试过表格超时

解决方案

据推测,您已经检查了现有代码和web.config,并尝试在那里增加超时: HttpSessionState.Timeout属性(System.Web.SessionState) [ ^ ]

如果不是工作,然后你需要与你的网络托管公司交谈:我知道有些人将它减少到五分钟,并设定超出此范围的增加被忽略,但十秒似乎相当极端。如果它已经被网络主机减少了,那么只有他们可以增加它,所以如果他们不合作,你将不得不转移到cookie。


你使用共享主机提供商吗?如果是,那么您无法在共享主机上使用会话。大多数共享托管服务提供商不支持会话。作为替代方案,您可以在代码上使用cookie。请参考:



- http://blogs.msdn.com/b/johan/archive/2006/11/20/sessionstate-performance.aspx

- http://forums.asp.net/t/1803857.aspx/1?Session+out+frequently+in+asp+net+

- http:// msdn .microsoft.com / EN-US /库/ ms972429.aspx

I am using VS 2008 for my application.

Code works fine locally
but on live session expires within 5 - 10 seconds
Please help

What I have tried:

I have tried all the practices to increase the session time out.

Web Config to increase using sessionState
also tried forms timeout

解决方案

Presumably, you've checked your existing code and web.config, and tried increasign teh timeout there: HttpSessionState.Timeout Property (System.Web.SessionState)[^]
If that doesn't work, then you need to talk to your web hosting company: I know that some reduce it to five minutes and have set that increases beyond that are ignored, but ten seconds seems rather extreme. If it's been reduced by the web host, then only they can increase it, so if they won't cooperate, you will have to move to cookies.


Are you using shared hosting provider? If yes, then you cant use session on shared hosting. Most of shared hosting provider don't support session. As an alternative, you can use cookies on your code. Please refer to:

- http://blogs.msdn.com/b/johan/archive/2006/11/20/sessionstate-performance.aspx
- http://forums.asp.net/t/1803857.aspx/1?Session+out+frequently+in+asp+net+
- http://msdn.microsoft.com/en-us/library/ms972429.aspx


这篇关于我的会话在5到10秒内到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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