|
Posted by comp.lang.php on 12/07/06 23:39
<?
header('Pragma: no-cache'); // ENSURE CLIENT-SIDE CACHE FLUSHING
$url = "$projectURLPath/index.php";
if ($_REQUEST['logoutMsg']) $url .= '?logoutMsg='.
urlencode($_REQUEST['logoutMsg']);
if ($willAuthenticate && $willUseSSL) {
$dest = 'https://' . $_SERVER['SERVER_NAME'] . $url;
} elseif ($willBasicAuthenticate && $willUseSSL) {
$dest = 'https://EnterYourUserName:EnterPassword@' .
$_SERVER['SERVER_NAME'] . $url;
} elseif ($willAuthenticate) {
$dest = 'http://' . $_SERVER['SERVER_NAME'] . $url;
} elseif ($willBasicAuthenticate) {
$dest = 'http://EnterYourUserName:EnterPassword@' .
$_SERVER['SERVER_NAME'] . $url;
}
header("Location: $dest"); // DEFAULT REDIRECT TO MAIN PAGE
exit();
?>
This code scriptlet will allow for redirection to dynamically relocate
to another URL. However, for some bizarre reason, it will not redirect
anywhere; it just dies (no warnings, no errors, no notices, no
nothing!), however, if you refresh your browser, the redirected page
appears, sometimes after 1, 2, 3 tries. Then sometimes it redirects
with no problems at all.
I tried closing my browser, logging out, refreshing everything,
deleting cache/history.. to no avail.
This only started occurring the moment I used my SessionHandler class
to relocate session files elsewhere due to a business requirement - the
moment I removed SessionHandler, this redirection weirdness occurred
and no amount of debugging seems to be able to solve the problem.
Ideas? Help?
Phil
[Back to original message]
|