如何独立地从2个不同的Web应用程序注销? [英] How to logout from 2 different web application independantly ?

查看:62
本文介绍了如何独立地从2个不同的Web应用程序注销?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

每个人我都不熟悉会话处理。这里我开发了一个用户可以使用Windows身份验证登录的Web应用程序。我还有另一个Web应用程序,它也使用Windows身份验证。两个应用程序拥有相同的用户名和密码,两者都可以同时登录。问题是,当我从我的网络应用程序注销时,它会自动从另一个应用程序注销。

有没有解决方案请与我分享。



我尝试了什么:



跟随session_start事件中的代码

Hello,
Everyone i am new to session handling.Here I have developed web application where user can login using windows authentication.Also I have another web application which also uses windows authentication.i.e both application have same user name and password and both can login simultaneously.Problem is that when i logout from my web application it automatically logout from another application.
Is there is any solution please share with me.

What I have tried:

following code inside the session_start event

string windowsLogin = this.Context.Request.LogonUserIdentity.Name;


            //Normally if the domain is present you get a string like DOMAINNAME\username, remove the domain
            int hasDomain = windowsLogin.IndexOf(@"\");
            if (hasDomain > 0)
            {
                windowsLogin = windowsLogin.Remove(0, hasDomain + 1);
            } //end if 
           Session["UserName"] = windowsLogin;







然后注销函数是javascript函数




then function for logout is javascript function

function Logout() {
          try {

              if (window.XMLHttpRequest) {

                  document.execCommand("ClearAuthenticationCache");

              }

              else {
                  alert("This feature requires Internet Explorer 6.0 Service Pack 1 or above. " + "Please close all browser windows in order to complete the logout process.");
              }
          }
          catch (e) {
              alert("This feature requires Internet Explorer 6.0 Service Pack 1 or above. " + "Please close all browser windows in order to complete the logout process.");
          }
          //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
          //self.close();
          window.close();

      }

推荐答案

嗯...没有办法退出使用Windows Auth的Web应用程序。下一个请求将再次将用户重新登录,因为每个请求都与其安全令牌一起发送,您无法更改。
Ummm... there is no way to "logout" of a web app that uses Windows Auth. The very next request will log the user right back in again since every request is sent with their security token and you can't change that.


这篇关于如何独立地从2个不同的Web应用程序注销?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆