I wonder if you have been so embarrassed:
When your page certification is based on a cookie-like approach, such as form,windows integration certification, the following operations sometimes certification failure, authentication (user authentication information) lost, need to log in again
After the system is logged in normally:
First page (pagea.htm): After window.showModalDialog (), the second page pops up (pageb.htm)
Second page (pageb.htm): After window.open (), the pop-up window (pagec.htm) sometimes jumps to the login page
This should be because the different pages exist in different processes, resulting in the identity of the information is not synchronized, the certification failed, but this is a certain probability occurred, after the help of Ms Consultant, finally found a way:
Generally speaking, when ShowModalDialog (), the window as an object parameter into the pageb.htm, in the PageB, with this argument to open (), so the problem is solved
Specifically as follows:
-----------pagea.htm--------------
...
var obj = new Object ();
Obj.mytestwindowa = window;//This window into an object parameter
window.showModalDialog ("pageb.htm", obj, "");
...
----------------------------------
-----------pageb.htm--------------
...
var obj = window.dialogarguments;//Gets the parameters of the previous page
Obj.myTestWindowA.open ("pagec.htm"); ...
----------------------------------
tested, no more identity loss, it's done!
Attentive friends will find that such an operation will result in pagec.htm, because opener is not pageb.htm but pagea.htm, so can not use Window.opener and pageb.htm communication, and open ( And can't pass the object parameter, Panic!
But fortunately in JavaScript, the object is a tree, you can hang anything on its branches, so we can communicate with pageb.htm for pagec.htm, pageb.htm transformation as follows:
----------- Pageb.htm--------------
...
var obj = window.dialogarguments;//Gets the parameters of the previous page
var Obj.myTestWindowA.myTestWindowB = new Object ();
Obj.myTestWindowA.myTestWindowB = window;//hangs pageb window under PageA window branches
Obj.myTestWindowA.open ("pagec.htm") (////////////////////////////
----------------------------------
This allows you to communicate with the PageB page's objects in Pagec, such as Window.opener.myTestWindowB.document.getElementById ("TextBox1"). value= "OK"
Note:
1. This may be just a situation, may be open again ShowModalDialog may also lead to the loss of identity information, but we just pass the no problem window to the next page, the problem can be solved.
(See http://www.ourac.net/read.php?tid=45123&fpage=2for missing conditions)
2. It may also occur during session, see http://support.microsoft.com/default.aspx?scid=kb; en-us;196383