Traitée Signout not working in Firefox browser

  • Thursday, March 22, 2012 5:06 AM
     
     

    Hi,

    We are using SharePoint 2007 and we developed custom signout page. The javascript in that custom signout page is given below.

    function _spBodyOnLoad()

    {

                    try

                    {

                                    document.execCommand("ClearAuthenticationCache");

                    }

                    catch (e) {}

                    var redirectUrl="<%=strRedirectUrl %>";

                    if(redirectUrl=="/_layouts/signout.aspx")

                    {

                        window.close();

                    }

                    else

                    {

                        window.location=redirectUrl;

                    }

    }

    The line which is in bold, does not work in firefox, but it works in Internet Explorer.

     document.execCommand("ClearAuthenticationCache");

    Please let me know the equivalent code for the above line, so that it works in firefox.

    Note: This problem is happening even for Out-of-Box signout of SharePoint 2007 in firefox browser.

    Thanks

    Ameer

    • Moved by Xue-Mei Chang-MSFTModerator Monday, March 26, 2012 2:59 AM sharepoint 2007 issue (From:SharePoint 2010 - General Questions and Answers)
    •  

All Replies

  • Wednesday, March 28, 2012 1:41 AM
    Moderator
     
     Answered

    Hi Ameer,

    you can do the following in firefox.

    <script language="javascript" type="text/javascript">

    try{
      var agt=navigator.userAgent.toLowerCase();
      if (agt.indexOf("msie") != -1) {
        // IE clear HTTP Authentication
        document.execCommand("ClearAuthenticationCache");
      }
      else {
        // Let's create an xmlhttp object
        var xmlhttp = createXMLObject();
        // Let's get the force page to logout for mozilla
        xmlhttp.open("GET",".force_logout_offer_login_mozilla",true,"logout","logout");
        // Let's send the request to the server
        xmlhttp.send("");
        // Let's abort the request
        xmlhttp.abort();
      }
      // Let's redirect the user to the main webpage
      window.location = "/rest/";
    } catch(e) {
    // There was an error
    alert("there was an error");
    }

    function createXMLObject() {
        try {
            if (window.XMLHttpRequest) {
                xmlhttp = new XMLHttpRequest();
            }
            // code for IE
            else if (window.ActiveXObject) {
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
        } catch (e) {
            xmlhttp=false
        }
        return xmlhttp;
    }
    </script>

    Thanks,

    Jack

  • Friday, June 08, 2012 6:27 AM
     
     

    Hi,

    I've tried paste the exact code by Jack Gao into JavaScript portion in SignOut.aspx, but it not work in my case, is there any variable require to change?