tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joaquín Sánchez Jiménez <qu...@fi2net.com>
Subject Re: User LogIn/LogOut
Date Thu, 16 May 2002 14:50:55 GMT
Hi:

You can detect browser is closing just using onUnload tag in body. Just do
this:

function doLogout() {
        document.formLogout.action='logout.jsp';
        document.formLogout.formOption.value='logout';
        document.formLogout.submit();
}

<body onUnload=doLogout();>
... here comes your html code

Then insert a form

    <form method="POST" name="formLogout">
        <input type="hidden" name="formOption">
    </form>


----- Original Message -----
From: "RamNivas" <rnivas@ablindia.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>; "Paul Balanoiu"
<Paul.Balanoiu@Siatel.RO>
Sent: Friday, May 17, 2002 1:22 PM
Subject: RE: User LogIn/LogOut


> Dear Paul Balanoiu
> Thanks a lot, This is really very use full for me :)
> Cheers
>
> Ram
>
>
> -----Original Message-----
> From: Paul Balanoiu [mailto:Paul.Balanoiu@Siatel.RO]
> Sent: Thursday, May 17, 2001 4:35 PM
> To: Tomcat Users List
> Subject: Re: User LogIn/LogOut
>
>
> HTTP is a request-based protocol. This means that you cannot detect if the
> user just closes the browser.
> You can do one of the following:
> 1. Set the Session expiration time to a custom value (usualy is set to 30
> min.) This value is the maximum precision you get for detecting user
logout.
> Don't set the value too low (if the user does not send any request for
this
> period of time, i.e. goes to have a cup of coffe, the session will be
> invalidated and the user will have to login again).
> 2. (not recommended) Use an applet in the webpages, to keep the session
> alive (i.e. the applet should send a HTTP request to the server per
minute,
> and the session timeout could be set to two minutes). This way you'll know
> that if the session timed out, then the user simply closed the browser).
>
> Paul
>
> ----- Original Message -----
> From: "RamNivas" <rnivas@ablindia.com>
> To: <tomcat-user@jakarta.apache.org>
> Sent: Friday, May 17, 2002 1:34 PM
> Subject: User LogIn/LogOut
>
>
> Dear All,
>
> I am having Tomcat Running on WinNT4.0.
>
> i want to track the user loggins and logouts  time  for inserrting in
> database.Using jsp how can i track the time user closes the browser or
> logout .
> i tried using JSP distroy method . but i'm having some troubles with htat
> can someone send me a working example of JSP distroy or any good method of
> tackling this problem
> regards  Ram
>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message