2013-12-12 2 views
1

내 사이트에서 기본 인증을 사용하도록 설정했습니다. IE, Mozilla 및 Chrome에서 사용자 자격 증명을 지울 수 있지만 Safari에서 자격 증명을 지울 수 없습니다. http://[email protected]Safari 5.1 기본 인증 로그 아웃 문제

그러나 모두 :

나는 401

  • URL에 전달 된 사용자 이름으로 Ajax 요청을 호출에

    1. 다음 Ajax 요청을 호출 및 설정 상태 코드를 시도 그들 중 일부는 제대로 작동하지 않습니다. 닫고 열 때마다 새로운 사파리 신임장이 전혀 삭제되지 않습니다.

      logoout 페이지에서 내가 스크립트 다음과 같습니다 :

      $.ajax({ 
          type: "POST", 
          contentType: "application/javascript", 
          async: true, 
          url: "../ClearAuthentication.aspx" 
      }); 
      

      그리고 우리는 같은 문제가 ClearAuthentication.aspx.vb

      'Context.Response.Redirect("http://www.test.com", False) ' have tried this both adding and removing 
      Response.StatusCode = 401 
      Page.Response.StatusDescription = "Unauthorized" 
      'Page.Response.AppendHeader("WWW-Authenticate", "Basic realm=""foo""") ' have tried this both adding and removing 
      Context.Response.End() 
      
  • 답변

    0

    아래는 코드입니다. 우리는 다음과 같은 해킹에 성공했습니다. 간단한 로그인 요청과 같지만 잘못된 자격 증명이 있습니다.

    function logout() { 
        var request = new XMLHttpRequest();           
        request.open("get", "/rest/login", false, user.login, "false");                                
        request.send();                
        window.location.replace("/"); 
    } 
    

    이 솔루션은 the question.

    에 대한 마지막 답변입니다