Does anyone know how can I keep the Javascript variable even though the page has been refreshed?
<p>Example:</p>

<ol>
<li><p>In the main page cliked on a button (NEW), the
page then will using Javascript to
open a new page in a new window by
calling redirectPage().</p></li>
<li><p>In the main page clicked on a button (EXIT),
then page then will call
confirmExit(), then
closeChildWindows() to closed all
popup new window before redirect to
another new page.</p></li>
<li><p>However, the JS variable
(childWindowHandles) will be always
reset if I refresh the main page,
and this cause the page unable to
close all other popup window before
relocated while EXIT button being
clicked</p></li>
</ol>

<p>Does anyone know how can I solve this problem? By able to keep the JS variable (childWindowHandles) even the main page being refresh? </p>

<pre><code>var childWindowHandles = new Array();

function redirectPage(url)
{
    childWindowHandles[childWindowHandles.length] = window.open(url)
}

function confirmExit(url)
{
    closeChildWindows()
    window.location=url
}

function closeChildWindows() 
{
    for (var loop=0; loop&lt;childWindowHandles.length; loop++) 
    {
        if (!childWindowHandles[loop].closed)
        {
                childWindowHandles[loop].close();
        }
    }
}
</code></pre>
