tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re[2]: User LogIn/LogOut
Date Fri, 17 May 2002 15:21:10 GMT
Hello JoaquĆ­n,

This is a nice thought, but I can disable it by turning off javascript
or using a browser that doesn't even support javascript.  Javascript
is to be used for functional enhancements.  It shouldn't be used as a
backstop for error handling or any other function that you need to count on
your application to do in order for things to work properly...unless
you state up-front that in order to use the application, javascript
at some specified version level (generally 1.2) *must* be enabled.

Jake

Thursday, May 16, 2002, 9:50:55 AM, you wrote:

JSJ> Hi:

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

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

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

JSJ> Then insert a form

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


JSJ> ----- Original Message -----
JSJ> From: "RamNivas" <rnivas@ablindia.com>
JSJ> To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>; "Paul Balanoiu"
JSJ> <Paul.Balanoiu@Siatel.RO>
JSJ> Sent: Friday, May 17, 2002 1:22 PM
JSJ> 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
JSJ> logout.
>> Don't set the value too low (if the user does not send any request for
JSJ> 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
JSJ> 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:
JSJ> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
JSJ> <mailto:tomcat-user-help@jakarta.apache.org>
>>
>>


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



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
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