note 8198 added to HTTP authentication with PHP
| From: | owld at mail dot ru | Date: | Wed, 30 Aug 2000 19:04:34 +0000 |
| Subject: | note 8198 added to HTTP authentication with PHP | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3684@lists.php.net to get a copy of this message | ||
<pre>
Good day.I've solve problem when 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>
</pre>
Dmitry Alyekhin
http://www.php.net/manual/features.http-auth.php