Session lost on window.open call

Last post 01-29-2009 10:01 AM by jreis. 3 replies.

Sort Posts:

  • Session lost on window.open call

    01-24-2009, 3:35 PM
    • Member
      11 point Member
    • jreis
    • Member since 06-19-2003, 7:48 AM
    • Posts 6

    I've got an ASPX page which stores a value in Session.  A button on that same page fires javascript which is a 'window.open' call.  The second window opens, but in the codebehind of the 2nd page, Session is gone.  I've run Fiddler to see what the Session cookie ID is, and it's exactly the same as was in the first window.

    Has anyone else experienced this?

    I tried in IE and Firefox, and it happens in both browsers.

  • Re: Session lost on window.open call

    01-24-2009, 5:19 PM
    Answer
    • Contributor
      2,703 point Contributor
    • Rick Matthys
    • Member since 01-20-2009, 3:57 PM
    • Oregon
    • Posts 390
    Just out of curiosity, I did a google for "session lost on window.open asp.net".  Looks like you're in good company. 
    Please mark the post as ANSWER if it helps you

    Disclaimer: Just my opinion. Not my employer or anyone else....
  • Re: Session lost on window.open call

    01-24-2009, 5:29 PM
    Answer
    • Contributor
      2,703 point Contributor
    • Rick Matthys
    • Member since 01-20-2009, 3:57 PM
    • Oregon
    • Posts 390

    Saw the root cause mentioned in a few places.  The reason is that the window is sometimes created in the wrong IE process, thus losing its session.  If using authentication, it will also prompt you for credentials even though you are already authenticated in the first browser.   

    See http://kbalertz.com/196383/Windows-Opened-Script-Authentication-Session.aspx for more details.  As for firefox, no idea.

    ~Rick

    Please mark the post as ANSWER if it helps you

    Disclaimer: Just my opinion. Not my employer or anyone else....
  • Re: Session lost on window.open call

    01-29-2009, 10:01 AM
    • Member
      11 point Member
    • jreis
    • Member since 06-19-2003, 7:48 AM
    • Posts 6

     EnableSessionState="false" was my downfall there.  Makes sense that session would be null, right? ;)

     Thanks.

Page 1 of 1 (4 items)