Javascript pop-up login cross-browser issue
<p>I have a page with an iframe in it.  Within the iframe, the default page runs some javascript to open a child window, login to an external service, then display some content from that external service back in the iframe.</p>

<p>My code works fine in Chrome and IE but in Safari and Firefox it does not.  In those browsers the parent window seems to ignore that fact that the user is now logged in to the external service and displays their "Not logged in" message instead of the info that is supposed to display.</p>

<p>Here's the code for what I'm trying to do.</p>

<p>HTML (main page):</p>

<pre><code>&lt;iframe id="brief" name="brief" src="contents/somepage.php?var=WXYZ" width="962" height="600"&gt;
&lt;p&gt;Your browser does not support iframes.&lt;/p&gt;
&lt;/iframe&gt;
</code></pre>

<p>somepage.php</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;
window.onload = function()
        {
var code = 'WXYZ';
var login = http://www.externalsite.com/brief/html.asp?/cgi-bin/service?msg=0048&amp;usr=username&amp;pwd=pass';

//OPEN CHILD WINDOW AND LOGIN USING VARIABLES ABOVE, THEN CLOSE WINDOW
childWindow=window.open(login,'','width=30,height=30,location=no');
var cmd = 'childWindow.close()';
setTimeout(cmd,2000);

//REDIRECT THIS IFRAME TO BRIEFING INFORMATION
var uri = 'http://www.externalsite.com/brief/html.asp?/cgi-bin/service?msg=0092&amp;AID=NOSEND&amp;MET=1&amp;NTM=1&amp;LOC='+code;
self.location.href=uri;
}
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&amp;nbsp;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I have tried adjusting various setTimeout functions to try to delay certain aspects of the script to wait for something else to happen but it doesn't seem to help.</p>

<p>Is there some cross-browser problem with this code that I am missing?</p>

<p>Thanks</p>
