| 78 | window.clearAuthenticationCache = function(page) { |
| 79 | // Default to a non-existing page (give error 500). |
| 80 | // An empty page is better, here. |
| 81 | if (!page) page = '.force_logout'; |
| 82 | try{ |
| 83 | var agt=navigator.userAgent.toLowerCase(); |
| 84 | if (agt.indexOf("msie") != -1) { |
| 85 | // IE clear HTTP Authentication |
| 86 | document.execCommand("ClearAuthenticationCache"); |
| 87 | } |
| 88 | else { |
| 89 | // Let's create an xmlhttp object |
| 90 | var xmlhttp = createXMLObject(); |
| 91 | // Let's prepare invalid credentials |
| 92 | xmlhttp.open("GET", page, true, "logout", "logout"); |
| 93 | // Let's send the request to the server |
| 94 | xmlhttp.send(""); |
| 95 | // Let's abort the request |
| 96 | xmlhttp.abort(); |
| 97 | } |
| 98 | } catch(e) { |
| 99 | // There was an error |
| 100 | return; |
| 101 | } |
| 102 | } |
| 103 | window.createXMLObject = function() { |
| 104 | try { |
| 105 | if (window.XMLHttpRequest) { |
| 106 | xmlhttp = new XMLHttpRequest(); |
| 107 | } |
| 108 | // code for IE |
| 109 | else if (window.ActiveXObject) { |
| 110 | xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); |
| 111 | } |
| 112 | } catch (e) { |
| 113 | xmlhttp=false |
| 114 | } |
| 115 | return xmlhttp; |
| 116 | } |