|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-01 12:25 UTC] nlopess@php.net
[2005-01-01 18:39 UTC] jaswinder_rana at hotmail dot com
[2005-01-01 19:08 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 08:00:01 2025 UTC |
Description: ------------ HTTP Authentication is not working. The login box keeps on coming back and $_SESSION['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] are never intilized. i spent 2 hours on it till i see there were same HTTP Authentication issue with earlier PHP versions. I even upgraded to latest fixzes from snaps.php.net and it di't still solve it. I am using Apache 2.0.44 just in case its server's issue. There are already issues but i din't see any with PHP4.3.10(and now after updating from snaps.php.net PHP4.3.11) so, i figured its good to mention so it can be fixed. Reproduce code: --------------- function error ($error_message) { echo $error_message."<BR>"; exit; } if ( (!isset($_SERVER['PHP_AUTH_USER'])) || $_SERVER['PHP_AUTH_USER'] !='user' || $_SERVER['PHP_AUTH_PW']!='pass') { header("WWW-Authenticate: Basic entrer=\"Admin\""); header("HTTP/1.0 401 Unauthorized"); error("Unauthorized access..."); } else { echo 'You are logged in..'; } Expected result: ---------------- You are logged in.. Actual result: -------------- Login box keeps on coming and it says $_SERVER['PHP_AUTH_PW'] undefined index