Php 从windows身份验证注销

Php 从windows身份验证注销,php,mysql,iis,active-directory,Php,Mysql,Iis,Active Directory,在我的公司,我设计了一个php mysql jquery网站,用于内部网库存。web服务器(iis8)位于连接到Active directory的windows 8计算机中。我需要为我的网站提供广告身份验证,为此,我启用了windows身份验证功能,以便在用户访问我的网站之前对其进行身份验证 该功能工作正常,用户现在可以登录了!但我需要他们从网站上注销。但我在互联网上找不到任何代码来做这件事。我现在需要做的是,告诉用户重新启动浏览器并清除浏览器历史记录。有人知道这件事吗?有没有其他方法 我试过这

在我的公司,我设计了一个php mysql jquery网站,用于内部网库存。web服务器(iis8)位于连接到Active directory的windows 8计算机中。我需要为我的网站提供广告身份验证,为此,我启用了windows身份验证功能,以便在用户访问我的网站之前对其进行身份验证

该功能工作正常,用户现在可以登录了!但我需要他们从网站上注销。但我在互联网上找不到任何代码来做这件事。我现在需要做的是,告诉用户重新启动浏览器并清除浏览器历史记录。有人知道这件事吗?有没有其他方法

我试过这个密码

html><head>
<script type="text/javascript">
function logout() {
    var xmlhttp;
    if (window.XMLHttpRequest) {
          xmlhttp = new XMLHttpRequest();
    }
    // code for IE
    else if (window.ActiveXObject) {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (window.ActiveXObject) {
      // IE clear HTTP Authentication
      document.execCommand("ClearAuthenticationCache");
      window.location.href='/where/to/redirect';
    } else {
        xmlhttp.open("GET", '/path/that/will/return/200/OK', true, "logout", "logout");
        xmlhttp.send("");
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4) {window.location.href='/where/to/redirect';}
        }


    }


    return false;
}
</script>
</head>
<body>
<a href="#" onclick="logout();">Log out</a>
</body>
</html>
html>
函数注销(){
var-xmlhttp;
if(window.XMLHttpRequest){
xmlhttp=新的XMLHttpRequest();
}
//IE代码
else if(window.ActiveXObject){
xmlhttp=新的ActiveXObject(“Microsoft.xmlhttp”);
}
if(window.ActiveXObject){
//IE清除HTTP身份验证
document.execCommand(“ClearAuthenticationCache”);
window.location.href='/where/to/redirect';
}否则{
open(“GET“,”/path/that/will/return/200/OK”,true,“logout”,“logout”);
xmlhttp.send(“”);
xmlhttp.onreadystatechange=函数(){
如果(xmlhttp.readyState==4){window.location.href='/where/to/redirect';}
}
}
返回false;
}
什么是/path/that/will/return/200/OK?

如果我理解的话

您是否在$\u会话中存储变量以保持用户的日志记录

如果是,您可以创建一个注销文件并将会话销毁。
如果您正在使用cookies,您需要清除注销文件中的cookies。

试试这篇文章:不,我没有使用任何会话。这一切都是通过IIS windows身份验证完成的。没有用于登录的代码。您是否使用:$\u服务器['PHP\u AUTH\u USER']?