• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what if browser is closed??

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi e'body..

well, i have a web application, which has a LOG-OFF Menu item on top of every screen(HTML/JSP page), on clicking on that Logoff I perform all the required work(with the help of a servlet) and take the user back to the index page where a user-id and password is asked.

The PROBLEM comes when the user(s) do not click the logg-off menu item BUT close the browser window by clicking the (X) on the top right of the browser; In this case IS there a work around way that I can call the servlet to execute OR a way where i can prevent the window from closing( this i pretty much doubt)..

Please help me on this issue..
i really appreciate your help in this matter.. thanks again
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try <body onclose="callServlethere();"> javascript event handling
 
Jack Daniel
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

thanks, BUT 'onclose' is not an event handler in <BODY> tag;
I tried it though, and it did not work :-(

anyway thanks
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you need to timeout the users session on the server there is nothing you can do to stop it.

Eric
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This scenario was discussed more than anything else on that forum.
If you search for "session timeout" you should get tons of tricks you can do.
By the way, this search criteria is also a best solution
 
Jack Daniel
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Thanks for your ideas, i think i found a way (After Seraching)..

My main point is not invalidating the session.. I have relied on Session Time-Out on the server for that...
I am working on Websphere on AS400.. so everytime you log on to AS400,
(which is required in my web application) there will be a job created: QZRCSRVS(on AS400, which has to be removed when user logs off, by calling as400inst.disconnectAllServices(), otherwise performance issue..), which can only be done by executing the above command; i know it's a flaw in AS400(NO timeOut for AS400 logon..).. but anyway i think i can call some server code, even if the browser is closed.

thanks anyway..

the code is below: IS there a way other than window.open() to call server code from javascript here.. i am not an expert in javascript..




Eric, maybe you can help me ;-)
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would go with session listeners - session timeouts - job gets removed.

As Eric likes to point - what if JavaScript disabled?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The trick of the neg. values only works on IE if I remember correctly.

If you are looking at IE you can always try

onbeforeunload and see what you can do with that.

*And yes, what if JS is disabled*

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic