Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session info into db

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when user logs in I am inserting user session start date/time in my db. when user clicks logged out then db record is updated but How can I know that user closed the browser/machine or timed out as to update db

Thanks & best regards
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way to know when they've closed their browser but a session listener is a good way to trap the creation and destruction of a session.
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
There is no way to know when they've closed their browser but a session listener is a good way to trap the creation and destruction of a session.


I am very new to servlet and Java. Can you please let me know about the session listener example or any tutorial

Thanks for your prompt reply
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34396
346
Eclipse IDE Java VI Editor
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:
Farakh,
Here's an example.


I tried a lot to check this example but every following error appears:

Thanks & best regards

Network Error (tcp_error)

A communication error occurred: "Operation timed out"
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.

For assistance, contact your network support team.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
It looks like there are a lot of examples on the web.
http://www.google.com/search?hl=en&q=session+listener+example&btnG=Google+Search

Have you tried any of these?


Thanks a lot!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic