Since two days I try to find my issue in a simple sample code:
<?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';
exit;
} else {
echo "<p>Hello {$_SERVER['REMOTE_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
}
?>
The Auth Popup open fine, I send User and Password. But the popup open again and again. If I cancel the popup the 401 message will displayed correctly.
I tried to fill a .htaccess with
RewriteRule ^(.*)$ index.php [E=REMOTE_USER:%{HTTP:Authorization},QSA,L]
But this change nothing. Thank you for any ideas to solve this!