note 8198 modified in features.http-auth by vrana

From: Date: Tue, 17 Aug 2004 13:56:09 +0000
Subject: note 8198 modified in features.http-auth by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79991@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. <?php 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 --was-- 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://php.net/manual/en/features.http-auth.php

« previous php.notes (#79991) next »