好了,所以我不使用任何會話變量,而我的代碼看起來是這樣的:
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="Enter your Twitter username and password:"');
header('HTTP/1.0 401 Unauthorized');
echo 'Please enter your Twitter username and password to view your followers.';
exit();
}
$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
所以,我的問題是,我怎麼能當用戶想退出的破壞登錄會話的(在這種情況下)Twitter的登錄憑據?
同樣的問題,同樣的答案在http://stackoverflow.com/questions/449788/http-authentication-logout-via-php – VolkerK 2009-07-01 00:28:30