[英]Asp.net Session Expire randomly on live Web server
我真的面對asp.net Web應用程序的問題。 我正在使用會話,在本地計算機和IIS服務器上似乎還不錯。
但是在我的實時服務器上,會話隨機終止(最長5分鍾,最多30分鍾)。 我嘗試了幾乎所有的可能性,但我從未贏過。
請告訴我我該如何解決我的問題。
您是否嘗試過webconfig ..
<configuration>
<system.web>
<sessionState timeout="20"></sessionState>
</system.web>
</configuration>
嘗試在session_end事件上實現對global.asax的登錄,並將會話模式設置為InProc
void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
}
<configuration>
<system.web>
<sessionState mode="InProc" timeout="20"></sessionState>
</system.web>
</configuration>
這樣您就可以找出會話過期的原因。
我也一直在研究同一件事,並發現了類似的帖子,說您的應用內存可能由於內存不足而被回收了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.