#20776 [Opn->Csd]: Login only possible from page where login is required.

From: Date: Mon, 09 Dec 2002 13:47:55 +0000
Subject: #20776 [Opn->Csd]: Login only possible from page where login is required.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-27177@lists.php.net to get a copy of this message
ID: 20776 Updated by: sniper@php.net Reported By: judd@ob-wan.com -Status: Open +Status: Closed Bug Type: Session related Operating System: Win2K Server PHP Version: 4.2.3 New Comment: All mentioned problems have been addressed in CVS. Closed. Previous Comments: ------------------------------------------------------------------------ [2002-12-09 02:20:57] judd@ob-wan.com Hi Sniper, I'll wait until an RC3 eventuates, rather than trying to build this right now. In addition to this morning's message, I have now discovered that part of my frustration was that there were TWO bugs in PHP-4.2.3 in the same piece of login script code! 1. session_register() is apparently quirky, as stated earlier. 2. The one I just discovered is that header() is apparently also broken. I had already mentioned a different behaviour depending on the way the URL is included (see original message in this report) but have just isolated that header() is evidently not doing enough to ensure the browser knows it has been redirected. This will have unreliable results: header("Location: $CFG->wwwroot/index.php"); This will not: redirect("$CFG->wwwroot/index.php"); function redirect($url, $message="", $delay=0) { /* redirects to a new URL using meta tags */ echo "<meta http-equiv='Refresh' content='$delay; url=$url'>"; if (!empty($message)) echo "<div style='font-family: Arial, Sans-serif; font-size: 12pt;' align=center>$message</div>"; die; } Ignoring the fancy formatting if you can, it looks like header() isn't flushing the browser. Hope this helps. ------------------------------------------------------------------------ [2002-12-08 22:43:41] sniper@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip ------------------------------------------------------------------------ [2002-12-08 22:34:50] judd@ob-wan.com Iliaa, My reply of 2 Dec 9:17pm contains a small script which demonstrates this fault. Don't know what else you want here. If you run this, you'll see "Dead session!!". Thus either session_register() or isset() is misbehaving compared to versions prior 4.2.3 <? session_start(); session_register("SESSION"); if (! isset($SESSION)) { echo("Dead session!!<br>"); } ?> ------------------------------------------------------------------------ [2002-12-07 01:24:07] iliaa@php.net Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Please use $_SESSION autoglobals rather then register_session to assing values to the session & if the problem persists please include a SMALL script in your reply. ------------------------------------------------------------------------ [2002-12-04 20:40:02] judd@ob-wan.com "If a man isn't a socialist at 20, he has no heart; if he is still a socialist at 40, he has no mind." Rob ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/20776 -- Edit this bug report at http://bugs.php.net/?id=20776&edit=1

« previous php.bugs (#27177) next »