Regarding sessions in asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • btreddy
    New Member
    • Oct 2008
    • 83

    Regarding sessions in asp.net

    Hii all.,

    I've some doubts on sessions in asp.net .

    If the client send a first request to a website then in response the site sends a sessionId which will be stored in browser as a sessioncookie upto this point its clear for me.

    If the same client sends the second request the session ID should send to the server to idetify the user.my question is How this will be send to the server??

    second question:

    why not the session_End event won't get fired if the session mode is OUTProc??if i want to execute some code when session ends where can i put that code??

    Thanks in advance for your help.

    Goodday.

    Rgds,
    Tirumala Reddy.B
  • btreddy
    New Member
    • Oct 2008
    • 83

    #2
    Somebody can help me in this regards.

    Thanks

    Tiru.

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      The Session ID is stored in a Session Identifier Cookie (as a value). Session looks for the cookie and retrieves the Session ID from it.

      Session_End is not fired if Session is configured to use something that is not InProc.

      I think to answer why you will have to first understand that the Session_End is actually fired when the Session ID is recycled.

      I'm going to assume that the only way that ASP.NET can tell if the Session ID has been recycled is if Session is configured to use InProc. I could be wrong, but this makes sense to me.

      -Frinny

      Comment

      • btreddy
        New Member
        • Oct 2008
        • 83

        #4
        Thanks for the reply.

        im not still clear about how the sessionid will send to webserver.

        -Tiru.

        Comment

        • mzmishra
          Recognized Expert Contributor
          • Aug 2007
          • 390

          #5
          The session ID is normally generated on the server. It's then sent to the client, either as a cookie in the HTTP headers, or by including it in the HTML, i.e. the links become href=a.html?ses sionid=12


          If the server is running in cookie-less mode, then the session key becomes part of the URL

          the client's next request will then contain the session Id, either in the cookie or the GET part of the request and the server parses it from there.

          If the server is expecting to use a session cookie but the client has cookies disabled, then from the perspective of the server, all requests are new sessions as it cannot tell that this is the same user.

          Comment

          • btreddy
            New Member
            • Oct 2008
            • 83

            #6
            Thanks mishra ji for your reply.

            So the sessionid will be added to the GET part if its a cookie session or to URl if its a cookieless session.am i correct?

            can we see that GET part ?


            Thanks & Regards,
            Tirumala Reddy B

            Comment

            • Frinavale
              Recognized Expert Expert
              • Oct 2006
              • 9749

              #7
              Were you asking about cookieless session??


              -Frinny

              Comment

              Working...