session variable and window.open

  • Thread starter Thread starter Benjie Fallar
  • Start date Start date
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
 
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
 
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="javascript">
function windowOpen()
{ window.open("another.asp","_blank"); }
</script>

This is a <a href="javascript:windowOpen();">link</a>
The session id = <%=Session.SessionID%>

another.asp

<%= Session.SessionID %>

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

try it!
 
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
 
i see that... thanks for your suggestion :) i guess i have to take that
one as a good advice.
 
Back
Top