I use this method below to exit an HTTP server using basic HTTP authentication. This works great with IE and FireFox. But in the case of Chrome, I can get the html file even with the wrong username and password.
In Chrome, the stream is flowing, I get the error "********** Failed ***********", after which the page is requested (some_server_file.html).
But in IE / Chrome, the stream is this, I get the error message "********** Failed ***********", and then an identifier is requested in the login dialog.
In some ways, Chrome sends the correct username and password even after the first request fails.
Can I fix a Chrome issue?
function logout() { jQuery.ajax({ type: "get", url: "some_server_file.html", async: false, username: "wronguser", password: "wrongpass", headers: {"Authorization": "Basic xxx"} }) .success(function () { console.log("********** Success ***********"); }) .fail(function () { console.log("********** Failed ***********"); }); return false; }
thanks
source share