views:

38

answers:

1

I have a parent window from which i open a modal dialog on button click. In WinXP with IE8 it works just fine, but in Win7 with IE8, upon opening the modal dialog it brings me to the login screen. If i enter my credentials, close the dialog and open it again, it works.

The explanation i figured out is that the session isn't transfered between parent and child. The modal is opened with javascript window.open function.

I don't want to store the credentials in a cookie and then read it in my modal because it's a security no-no. Is there an explanation why this is happening in Win7 and not in XP and is there a resolution for this issue?

+1  A: 

Session resides on the server, so as long as the browser sees the modal dialog as the same site (server etc) it will identify itself to the server, which will then pull up the session details. Perhaps you have cookies disabled somewhere.

Why don't you print out the session value on both screens? Is it null the first time you open the modal dialog?

My guess is this is something do with an if(IsPostPostBack) in the modal dialog. Other than that if you can post some code i'll certainly take a look.

m.edmondson
thanks for the help, but i actually figured it out... It seems that on Win Vista and later window.open actually opens a new process and does not inherit the SessionID of the parent. So the solution would be either using showModalDialog or showModelessDialog. Either way for web applications, using window.open is not a good idea.
GxG
Ah so I was spot on then :-) "so as long as the browser sees the modal dialog as the same site (server etc) it will identify itself to the server" it obviously wasn't firing the correct cookies back to the server. Glad you got it fixed.
m.edmondson
thanks... tip of the day: Don't use window.open unless it points to a site not related to your application
GxG
You mind accepting the answer?
m.edmondson