Maintain sessionID

Last post 07-21-2008 8:20 AM by My Crystal. 2 replies.

Sort Posts:

  • Maintain sessionID

    07-21-2008, 5:06 AM
    • Member
      49 point Member
    • girishnehte
    • Member since 01-15-2007, 10:13 AM
    • India
    • Posts 384

    Hello Friends,

    In my web application I had used sessionID. Now at one page I had written session.sessionID and after getting redirected to some another page pf sam eapplication again I write sesison.sessionID. I found both the vakyes different. How this is. If both the pages belogs to same session ans same application then session ID sould be same. Why I had found different values? Please if anybofy can explain me.

    Thanks & Regards
    Girish Nehte

    Thanks & Regards
    Girish Nehte

    If This post helps you to solve your problem please mark this as an answer.
  • Re: Maintain sessionID

    07-21-2008, 7:12 AM
    Answer

    hI When using cookie-based session state, ASP.NET 2.0 does not allocate storage for session data until the Session object is used.

    so u will getting new  session ID for every request  request event if u are refreshing the same page.

    until the session object is accessed. if u want same seesionid accross the application for a page just store any variable in session state.

    and u will get the desired result.

    Thanks and Regards
    Somnath
    http://silverlightcsharp.blogspot.com
    Please click “Mark as Answer” on the post if it helps you,
  • Re: Maintain sessionID

    07-21-2008, 8:20 AM
    • Participant
      1,340 point Participant
    • My Crystal
    • Member since 06-08-2008, 10:09 AM
    • Guangzhou, China
    • Posts 334

    hi, Girish

    Som Nath is right. ASP.NET doesn't give a fixed session id until some page executes code like "HttpContext.Current.Session.Add("name", "value");" Maybe this is a way to prevent security hole.

    What really matters most is the chance to communicate with you, my friends, rather than marking my post as answer, though I would be really appreciated if you do so.

    ASP.NET 3.5 MCTS
Page 1 of 1 (3 items)