note 8198 modified in HTTP authentication with PHP by ronabop

From: Date: Sat, 23 Sep 2000 18:00:32 +0000
Subject: note 8198 modified in HTTP authentication with PHP by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-5437@lists.php.net to get a copy of this message
Good day.I've solved a problem where IE4 asks for the age one more time after a 401, defeating sending a 401 once to force a user to log on again. function authenticate() { setcookie("noauth",""); Header( "WWW-authenticate: Basic realm=\"test\""); Header( "HTTP/1.0 401 Unauthorized"); echo "You must enter user name"; exit ; } if ( !isset($PHP_AUTH_USER) || ($logoff==1) && $noauth=="yes" ) { authenticate(); } And logoff link - <a href="samehtml.phtml?logoff=1">Logoff</a></td> Dmitry Alyekhin http://www.php.net/manual/http-authentication-with-php.php

« previous php.notes (#5437) next »