unset function not working
| From: | Martin A. Marques | Date: | Fri, 30 Jun 2000 20:15:26 +0000 |
| Subject: | unset function not working | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-4134@lists.php.net to get a copy of this message | ||
I have a script in which I'm trying to unset the variable $PHP_AUTH_USER, but
it doesn't get unset. Whats wrong?
The function is something like this:
<?
if (! isset($PHP_AUTH_USER)) {
Header("WWW-Authenticate: carga basica=\"Carga de datos\"");
Header("HTTP/1.0 401 Unauthorized");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
echo "No se puede cargar datos si no es un usuario autorizado.\n";
exit;
}else{
if (confition){
// Do something!!!
}else {
// Authentification failed.
unset($PHP_AUTH_USER);
header(location: index.php); //index.php is this same script!
}
}
when the authentification fails, it doesn't seem to be unseting the
$PHP_AUTH_USER variable, because it goes back to the page and returns no data
(as an error message from netscape)
I'm using PHP 4.0.0 with apache 1.3.12 on Solaris, and netscape 4.7 on
solaris and linux, with the same luck!
Any ideas??
--
"And I'm happy, because you make me feel good, about me." - Melvin Udall
-----------------------------------------------------------------
Martín Marqués email: martin@math.unl.edu.ar
Santa Fe - Argentina http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------