I was having problems with users getting the
"You must be logged in
to access this page." when cookies were properly enabled and the
server settings were correct. This occasionally happens in IE 5.0,
and always happens in Opera 6.01.
Cause: Race condition in
redirect.php. The cookies are being sent, and a Location: header is
being sent, but no html. The cookies may or may not be set before the
page from the Location: header is loaded. IE: 50/50, Opera: 95/5
fail/success. Therefore, the PHPSESSID cookie is missed, and the
resulting "not logged in" page is given.
< header("Location: $redirect_url");
echo "<html><head><META HTTP-EQUIV=\&quot;Refresh\&quot; CONTENT=\&quot;0;
html is sent in this case, all header information has to be received
and processed before the html can be processed. The cookies are
registered before the jump to the new page. An attempt at a shortcut
with the Location: is what causes the race condition.