The script I proposed doesn't seem to work right, since it calls the function logout() every time the page is changed, not only when the browser window closes... it only works right when your web application is in a frameset page that never changes, and the onunload="logout();" is in...