PHP 4.0 Bug #8220: When i give unset($PHP_AUTH_USER) it's not destroying the variable

From: Date: Wed, 13 Dec 2000 08:27:43 +0000
Subject: PHP 4.0 Bug #8220: When i give unset($PHP_AUTH_USER) it's not destroying the variable
Groups: php.dev 
Request: Send a blank email to php-dev+get-41123@lists.php.net to get a copy of this message
From: kpsdevi@pol.net.in Operating system: Linux PHP version: 4.0.3pl1 PHP Bug Type: *Function Specific Bug description: When i give unset($PHP_AUTH_USER) it's not destroying the variable i included the following code in one file. <?php if(!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic Realm="Enter your login name and password"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization required'; exit; } else { require("mysqlconn.inc"); $sql = "select password from users where username = '$PHP_AUTH_USER'"; $result = mysql_query($sql,$conn); $row = mysql_fetch_array($result); if($PHP_AUTH_PW != $row[0]) { header('WWW-Authenticate: Basic Realm="Authorization failed : Enter Username and password"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization required'; mysql_free_result($result); mysql_close(); exit; } mysql_free_result($result); mysql_close(); } ?> I have included the following code to logout the user <? unset($PHP_AUTH_USER); ?> but it's not destroying the variable $PHP_AUTH_USER. -- Edit Bug report at: http://bugs.php.net/?id=8220&edit=1

« previous php.dev (#41123) next »