ASP.NET - Lifespan of Session Variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sivangari
    New Member
    • Jul 2008
    • 2

    ASP.NET - Lifespan of Session Variable

    In my application i have session.When i close the browser without signing out or when i restart my IIS .My session gets null or exchanged.

    Can anybody help me out..
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi Sivangari,

    A Session has a limited lifespan and is ended when, amongst other things, you close the browser, a page errors or a session times out.

    If you are trying to store data across sessions then you will need to use something else like a database or xml file.

    Hope this helps,

    Dr B

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      When you close your browser your Session ID cookie is removed.
      Therefore, when the user comes back to your page later the Server determines that there is no Session Identifier cookie and creates a new Session for the user.

      What do you mean by "exchanged" ?

      -Frinny

      Comment

      Working...