session variable and window.open

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    #1

    session variable and window.open

    Hi all, I have a website where I want to be able to 'pop up' a window using
    the window.open call in JavaScript.
    I remember back in the old days of classic ASP there was a problem where a
    call to window.open started a new session and all session variables were
    lost.
    I did a quick check in ASP.Net and the session variables were saved between
    the parent window and the new 'pop up' window so that's fine.

    What I want to know is there any problems with doing this (Browser issues
    etc) as I do not want to pass though any information via the Querystring
    (Security issue).

    Thanks in advance
    Mark


  • Natty Gur

    #2
    Re: session variable and window.open

    Hi,

    As in the old happy days of ASP and COM using window.open still can end
    up with new session. if you want to be sure that the new window maintain
    the same session use javascript to pass cookies from the calling page to
    the new one.

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    • Benjie Fallar

      #3
      Re: session variable and window.open

      correction: it still holds true even in classic ASP.

      "Mark" <mark@yahoo.com N0SPAM> wrote in message
      news:beimm4$fuu $1@lust.ihug.co .nz...[color=blue]
      > Hi all, I have a website where I want to be able to 'pop up' a window[/color]
      using[color=blue]
      > the window.open call in JavaScript.
      > I remember back in the old days of classic ASP there was a problem where a
      > call to window.open started a new session and all session variables were
      > lost.
      > I did a quick check in ASP.Net and the session variables were saved[/color]
      between[color=blue]
      > the parent window and the new 'pop up' window so that's fine.
      >
      > What I want to know is there any problems with doing this (Browser issues
      > etc) as I do not want to pass though any information via the Querystring
      > (Security issue).
      >
      > Thanks in advance
      > Mark
      >
      >[/color]


      Comment

      • Benjie Fallar

        #4
        Re: session variable and window.open

        i tried to prove i said that using window.open in client-side script will
        produce the same SessionID by creating two asp pages.

        default.asp
        <script language="javas cript">
        function windowOpen()
        { window.open("an other.asp","_bl ank"); }
        </script>

        This is a <a href="javascrip t:windowOpen(); ">link</a>
        The session id = <%=Session.Sess ionID%>

        another.asp

        <%= Session.Session ID %>

        Walah!!! they produced the same SessionID value!!!

        try it!

        "Natty Gur" <natty@dao2com. com> wrote in message
        news:usKjx5pRDH A.2460@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Hi,
        >
        > As in the old happy days of ASP and COM using window.open still can end
        > up with new session. if you want to be sure that the new window maintain
        > the same session use javascript to pass cookies from the calling page to
        > the new one.
        >
        > Natty Gur, CTO
        > Dao2Com Ltd.
        > 28th Baruch Hirsch st. Bnei-Brak
        > Israel , 51114
        >
        > Phone Numbers:
        > Office: +972-(0)3-5786668
        > Fax: +972-(0)3-5703475
        > Mobile: +972-(0)58-888377
        >
        > Know the overall picture
        >
        >
        > *** Sent via Developersdex http://www.developersdex.com ***
        > Don't just participate in USENET...get rewarded for it![/color]


        Comment

        • Natty Gur

          #5
          Re: session variable and window.open

          Yes I know. but in my 10 years of expirence and almost 3 in ASP.NET the
          same code that works, from time to time dont behave as expected and
          create new session.

          Natty Gur, CTO
          Dao2Com Ltd.
          28th Baruch Hirsch st. Bnei-Brak
          Israel , 51114

          Phone Numbers:
          Office: +972-(0)3-5786668
          Fax: +972-(0)3-5703475
          Mobile: +972-(0)58-888377

          Know the overall picture


          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Benjie Fallar III

            #6
            Re: session variable and window.open

            i see that... thanks for your suggestion :) i guess i have to take that
            one as a good advice.



            *** Sent via Developersdex http://www.developersdex.com ***
            Don't just participate in USENET...get rewarded for it!

            Comment

            Working...