Win a copy of Production-Ready Serverless (Operational Best Practices) this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Browser Closing without signout from site  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using Tomcat 3.2 version. I have an application in which
i have to capture user login and logout time. I am storing the
login time and logout time in database table.
If user logout by clicking logout button then page navigate to some processing page in which i take the logout time and stored in database table.
My problem is "If user close the browser after login into the application without logout then i am unable to capture the logout time".
Can any one help me how to find out the logout time when user closes the browser directly after login without logout.
Adv Tks,

------------------
Malli
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to use JavaScript to capture the event that the browser is closing, and make it request some jsp page which tells your system that the user has logged out.
It's not a very good solution, since it's pretty browser dependent, and probably it could be solved by designing your application in some other way.
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zem can u elaborate it a little more as i am having the same problem
how to invoke a jsp using javascript
thanks
saurabh
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a difficult problem to solve and have not found an actual workable solution. Instead, I record the time that the user explicitly logs out; or, if he doesn't log out, I record the time that the session expires (set to 30 minutes) by using an HttpSessionBindingListener to determine when the session is invalidated by the servlet container.
 
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!