Logging out when you close the browser
Moderator: General Moderators
Logging out when you close the browser
I have recently been working with a system that you can use a browser to configure it. What interested me is that when you attempted to close the browser down a new window would open asking wether you wanted to logout og the programming session. How is that done? Be easy with me I know nothing of JS.
Nincha, belated thanks. I have managed to get it to work in a fashion, but I need to make it a little neater by also resizing the window it will open. I have tried the follwing but no joy.
Can anyone help me?
Code: Select all
<html>
<head>
<script script language="JavaScript">
function LogoutSessionUser()
{ window.open("http://www.touch.com/support/desk/sesslogout.php",
'toolbar=no,location=no,directories=no,status=no,menubar=no,
scrollbars=no,resizable=no,width=200,height=100')
}
</script>
</head>
<body onUnload=LogoutSessionUser()>
</body>
</html>a little more
exactly what qman said but i find that it is sometimes neccessary to put a semi colon at the end or the onUnload event like so
phpScott
Code: Select all
<body onUnload="LogoutSessionUser();">