Which sessionState mode in these circumstances?

Discussion in 'ASP.NET / ASP.NET Core' started by Owen Ransen, May 6, 2014.

  1. I'm learning about SessionId and Session state stuff.

    This article is quite a gentle intro, and I think, that since my site will not be used super heavily (I don't anticipate more than 20 users at once) I suppose I can use the default InProc session mode.

    Am I right?

    And if I am do I need to add...
    Code:
    sessionState mode="InProc" timeout=30
    ...into my web config file?
     
  2. FrankC

    FrankC DiscountASP.NET Staff

    Does your site rely heavily on Session? Note that if you use Inpro session, when the process spin down, you'll lose the session.

    I recommend using SQL session.
     
    Owen Ransen likes this.
  3. By "spin down" do you mean when the session ends, when the user moves away from my site?
     
  4. I believe what Frank is referring to is to how your application pool process will "spin down" (read: shut down) after a sufficient period inactivity.

    So if a customer in your site is in a session, and does not do anything for a sufficient amount of time the application pool will shut down and the inProc session will be lost, if they were to return to their computer and try to resume activity they would see that their session was lost and they would have to start whatever they were doing again.

    If your sessions were stored in your SQL server they would be preserved, so that in the situation above when the client returns to his computer and starts interfacing with your site again he could pick right up where he left off.
     
  5. So that is the timeout setting in the web config file?

    Code:
    <configuration>
    ...
    <system.web>
    <sessionState mode = "InProc" timeout="20"></sessionState>
    </system.web>
    </configuration>
    
    So "spin down" means it is a Session_End event prompted by the inactivity after a timeout?
     
  6. I have a big problem: I only have a three (3) neuron brain. I'm learning C# & ASP.NET and I'm scared that if I start learning SQL at the same time my brain will explode...
     
  7. FrankC

    FrankC DiscountASP.NET Staff

    Owen Ransen likes this.
  8. Thanks for the link, I've a few other things to sort out at the moment, but when I'm feeling strong again next week I'll give it a serious go.
     

Share This Page