There are events in the browser, such as "onUnload" that allow you to catch the browser window leaving the page. I have used this in a framed environment, the top frame had this:
 
<FRAMESET ROWS="74,*" BORDER="0" FRAMEBORDER="0" FRAMESPACING="0" >
 
and the function was thus:
 
 function OfferLogout() {
  var ConfirmBox = false;
  if (!document.layers){
   if (!ToLogout) {
    logout = confirm('Would you like to logout now?');
    ConfirmBox = true;
   } else {
    logout = true;
   };
    if (logout) {
     if (ConfirmBox) {
      // Open a new window so that the parent window
      // can continue to go where the user intended
      window.open('/logout.taf?MDI=true','CloseMe','innerHeight=100,innerWidth=100,location=no,menubar=no,personalbar=no,resizable=no,screenX=100,screenY=100,scrollbars=no,status=no,toolbar=no,width=100,height=100,dependent=yes')
      
     } else {
      // in this window
      document.location.href= '';
     };
      return true;
    } else {
     return false;
    };
  };
 };
Still not quite foolproof, but it works more often than not.
 
Anthony -
 
 
----- Original Message -----
Sent: Saturday, May 15, 2004 12:37 AM
Subject: Witango-Talk: Variable Timeout solution

I would like to detech when a user login to my application and be able to know when they leaving even without proper way of logout. Just like other chat application, if a user online, the user will appear in a list. if the user inactive for certain period, the user will be automatically logout and disappear from the list.
 
I have try to use the Witango system variable - variableTimeout but it have not effect. Can anybody help?
 
Thanks.
 
Regards,
Tan
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to