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" <[EMAIL PROTECTED]> JSJ> To: "Tomcat Users List" <[EMAIL PROTECTED]>; "Paul Balanoiu" JSJ> <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]] >> 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" <[EMAIL PROTECTED]> >> To: <[EMAIL PROTECTED]> >> 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:[EMAIL PROTECTED]> >> For additional commands, e-mail: >> <mailto:[EMAIL PROTECTED]> >> >> >> >> -- >> To unsubscribe, e-mail: >> <mailto:[EMAIL PROTECTED]> >> For additional commands, e-mail: >> <mailto:[EMAIL PROTECTED]> >> >> >> -- >> To unsubscribe, e-mail: JSJ> <mailto:[EMAIL PROTECTED]> >> For additional commands, e-mail: JSJ> <mailto:[EMAIL PROTECTED]> >> >> JSJ> -- JSJ> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> JSJ> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- Best regards, Jacob mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>