We are detecting when the user closes the browser window with this
javascript (only in IE with JS enabled):

<script>
function logoff() {
        if (document.all) {
                // IExplorer
            if (window.screenTop > 9000) {
                // window closed
                top.location="<%=request.getContextPath()%>/logoff.do";
//get the logoff action
                } else {
                // window refreshed
                }  
        }
}
</script>
<body onunload="logoff();">

</body>

Hope this help.
Cheers.
Guillermo.

-----Original Message-----
From: Frank Zammetti [mailto:[EMAIL PROTECTED] 
Sent: Lunes, 21 de Junio de 2004 01:03 p.m.
To: [EMAIL PROTECTED]
Subject: RE: Detecting browser close


It was my understanding that only signed scripts could open popups 
off-screen, or of too small a size (I think 100px in either direction).

I use the approach you outline as well, although it's not critical that
the 
user logs out of my app anyway but they do feel good about having an 
explicit logout button.  I however pop up a small "now logging out"
message 
for them in the new window, partly because I think that's perhaps nicer
to 
show that what they asked to happen actually did, but also because an 
off-screen popup wasn't allowed.

Just curious how you got the off-screen popup to work without a signed 
script (assuming you didn't have one?).


>From: "Joe Hertz" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
>Subject: RE: Detecting browser close
>Date: Mon, 21 Jun 2004 11:56:56 -0400
>
>This is fine if you want to provide a popup window to the user. This 
>still isn't an authoritative way of determining if the user has "logged

>out".
>
>Your app should never depend on the client's PC having electricity.
>
> > -----Original Message-----
> > From: Simone - Dev [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, June 20, 2004 6:48 AM
> > To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
> > Subject: R: Detecting browser close
> >
> >
> > What I'm proposing to you it's a solution that works only on JS 
> > enabled browsers, but since this is almost the 99,99% of the browser

> > on the market shouldn't be a problem :-)
> >
> > On the onClose event of the window object (javascript object) opens 
> > a new window of 10px that is displayed off the screen (8000px left):

> > this windows will contain a page that close all session specific 
> > resources as soon as the user exit, without having to wait the 
> > session timeout to expire
> >
> > I used it many times, also to provide a "u forgot to save what you 
> > did, are you sure you want to exit the page?" alert (but this need a

> > onBeforeClose event that is available only on IE).
> >
> > Simone
> >
> > -------------------------
> > Simone Chiaretta
> > www.piyosailing.com/S
> > Any sufficiently advanced technology is indistinguishable from magic

> > "Life is short, play hard"
> >
> >
> > > -----Messaggio originale-----
> > > Da: ksitron [mailto:[EMAIL PROTECTED]
> > > Inviato: sabato 19 giugno 2004 23.32
> > > A: Struts Users Mailing List
> > > Oggetto: Detecting browser close
> > >
> > >
> > >
> > > Is there a way to detect when the user closes the browser.
> > What I want
> > > to do is do clean-up and destroy the session.
> > >
> > >
> > > Thanks in advance.
> > >
> > > --
> > >
> > >
> > >
> > >
> > >
> > >
> > --------------------------------------------------------------------
> > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > --------------------------------------------------------------------
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

_________________________________________________________________
MSN 9 Dial-up Internet Access fights spam and pop-ups - now 3 months
FREE! 
http://join.msn.click-url.com/go/onm00200361ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las 
personas direccionadas en el mail y puede contener informacion (i)de propiedad 
exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier 
opinion en el contenido, es exclusiva de su autor y no representa necesariamente la 
opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion 
esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna 
por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha 
recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo 
inmediatamente junto con todas las copias del mismo, notificando al remitente. No 
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus 
partes si usted no es el destinatario. Muchas gracias.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to