问题描述
我在web.config文件中此设置:<的sessionState超时=540/>
。这种试图使所有会议8小时后过期。然而,会话过期比快多了,我得到了一个对象引用不设置到对象错误的实例。可能有的告诉我,如果还有别的东西影响会话?
I have this setting in the web.config file: <sessionState timeout="540" />
. This tries to make all the sessions expires after 8 hours. However, the session expires much faster than that and I got an object reference not set to an instance of an object error. Could some tell me if there is something else affects the session?
在此先感谢!
推荐答案
的sessionState也到期如果应用程序池回收(不活动,异常或配置)
Sessionstate expires also If the application pool recycles (inactivity, exception, or configuration)
反正不是最佳做法,延长这么多的sessionState超时
anyway is not a best-practice to extend so much the sessionstate timeout
也许你应该改变你依赖会话或使用不同的方式来坚持这些对象(viestate)
maybe you should change you dependency to session or use a different way to persist those objects ( viestate )
如果你绝对需要有会坚持这么多,你应该使用其他服务器或DB作为会话存储。
if you absolutely need to have session to persist so much you should use another server or a db as session store.
这篇关于SessionState会超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!