HelloCW
HelloCW

Reputation: 2355

What happened in asp.net 2.0 when session lost?

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 will be happened when the session lost during accessing a webpage?
Thanks!

Upvotes: 2

Views: 192

Answers (2)

Nickz
Nickz

Reputation: 1880

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

Upvotes: 0

Russ Cam
Russ Cam

Reputation: 125538

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.

Upvotes: 0

Related Questions