Session Time-out and onClose event

suhaiza

Newcomer
Joined
Mar 23, 2007
Messages
1
i got this requirement from user.

- If user close IE before signing out Infohub, it will automatically sign out for user.
- If the system left to idle more than 24hours, end the session and log off.
- If user open 2 browser at the same time using the same pc, and login using same ID at the both browser, and close one of the browser, it will also end the session for the other browser.

I found some entry saying bout using 'onClose' event but i'm not sure how to apply it in my code.

Right now i'm using asp.net.

Help will be appreciate.
 
i got this requirement from user.

- If user close IE before signing out Infohub, it will automatically sign out for user.

I did something like this once using javascript.

insert this in your markup code

Visual Basic:
<script language="javascript">
function resetStatus()
{
var abssize = document.body.offsetWidth-30;
if((event.clientY < 0 && event.clientX >= abssize) || (event.clientY < 0 &&
event.clientX >= 0))
{
alert("The page will now close.");
window.open("forceLogout.aspx", "_blank");
}
}
		</script>

and then also in the markup(html), change <body> to <body onbeforeunload="resetStatus()">

but for this you would need to add a page called forcelogout.aspx which, on load, logs out the current user.
 
Back
Top