【发布时间】:2016-04-18 17:17:49
【问题描述】:
我有以下问题:
我使用 HTTP 身份验证登录。我在 php 中结束了会话,但用户和密码的变量仍然存在而没有关闭 网页浏览器。有没有办法在不关闭网络服务器的情况下清除这些变量。
我的测试站点:
1.- login.php (HTTP Authentication and mysql users data base);
2.- If ok user and password go to page1.php else kept prompting for user and password;
3.- In page1.php there is a link to logout.php which ends the php session.
4.- If I click the button back to page1.php it tells me that I am logged out and gives me a link to login.php to login again.
5.- When click the link to login again there is not prompt for user and password it redirects me to page1.php and tells me that I am
logged in with same user and password as the firs time.
提前感谢您的帮助。
雷神6006
【问题讨论】:
-
浏览器将继续发送 http basic 的 auth/pass 直到浏览器被告知它们不再有效 - 例如。 Web 服务器必须发送 401/unauthorized 来欺骗浏览器认为凭据不再有效。
-
感谢您的回答我使用这个:header("HTTP/1.1 401 Unauthorized");出口;没用
标签: php mysql http authentication