Logout on Brower Window Close?

Is there a way to log a user out on browser close? We have very long session timeouts (because we’re doing NTLM) and so we can’t relealy rely on them timing out.

I’ve tried the following script, but it’s not working:

function logout()
//alert(“function called”);
window.location = window.location.protocol + “//” + window.location.host + “//?method=logout&returnUrl=http://www.google.com/”


Any help is appreciated!