开发者

What happened in asp.net 2.0 when session lost?

开发者 https://www.devze.com 2023-03-17 18:05 出处:网络
I use InProc mode to store session (sessionState mode=\"InProc\" cookieless=\"false\" timeout=\"240\"), I know sometimes the session will lost in InProc mode,what wi开发者_运维问答ll be happened when

I use InProc mode to store session (sessionState mode="InProc" cookieless="false" timeout="240"), I know sometimes the session will lost in InProc mode,what wi开发者_运维问答ll be happened when the session lost during accessing a webpage?

Thanks!


In the Global asax you can handle a InProc Session end event:

void Session_End(Object sender, EventArgs E) 
{     
    // do something 
}

A few reasons an InProc Session will died:

  • Your IIS Application Pool has died, reset or etc.
  • ASP.NET Worker Process (Aspnet_wp.exe) is recycled unexpectedly, overriding your bin or web.config


If an event occurs that causes the Application Pool to be recycled then InProc session will be lost. If the application is servicing a request, then I don't believe that the session associated with that request is lost, at least not until the response is served anyway.

0

精彩评论

暂无评论...
验证码 换一张
取 消