且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用的.htaccess(和htpasswd的)身份验证时注销?

更新时间:2023-12-03 11:17:40

浏览器通常不支持这一点,看到的如何退出?

Browsers usually don't support this, see How do I log out?

由于浏览器第一次启动   实现基本身份验证,   网站管理员一直想   知道如何让用户注销。   由于浏览器缓存的用户名   和密码与认证   领域,如在此前面所描述   教程,这不是一个函数   服务器配置,但它是一个   让浏览器的问题   忘记了凭据信息,所以   下一次的资源是   请求,用户名和密码   必须再次供给。有   许多情况中,这是   合乎需要的,当使用如   浏览器在一个公共位置,并且不   希望离开登录浏览器   在,从而使下一个人可以得到   到您的银行帐户。

Since browsers first started implementing basic authentication, website administrators have wanted to know how to let the user log out. Since the browser caches the username and password with the authentication realm, as described earlier in this tutorial, this is not a function of the server configuration, but is a question of getting the browser to forget the credential information, so that the next time the resource is requested, the username and password must be supplied again. There are numerous situations in which this is desirable, such as when using a browser in a public location, and not wishing to leave the browser logged in, so that the next person can get into your bank account.

然而,虽然这也许是   最常见的问题有关   基本身份验证,迄今没有   各大浏览器厂商纷纷   看到了这一点作为一个可取的特点   投入到自己的产品。

However, although this is perhaps the most frequently asked question about basic authentication, thus far none of the major browser manufacturers have seen this as being a desirable feature to put into their products.

因此,这个问题的答案   问题是,你不能。对不起。

Consequently, the answer to this question is, you can't. Sorry.

有浏览器扩展,使您以清除站点的HTTP验证。 对于Firefox在 WebDeveloper 扩展(这是我的favourtie扩展名之一反正)提供了此功能。 这个菜单是杂项/清除私有数据/ HTTP认证

There are browser extensions that allow you to clear the HTTP authentication for a site. For Firefox the WebDeveloper extension (which is one of my favourtie extensions anyway) offers this feature. The menu for this is Miscellaneous/Clear Private Data/HTTP Authentication.