wood burning stoves*
The moose likes Servlets and the fly likes How to find wether a session is valid using Session ID. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to find wether a session is valid using Session ID." Watch "How to find wether a session is valid using Session ID." New topic
Author

How to find wether a session is valid using Session ID.

I Arvind Jai
Greenhorn

Joined: Feb 21, 2007
Posts: 1
Hi,
I have a requirement in my application to reset DB status of a UserID when the users session gets invalidated upon network disconnection. To do this, my idea is to store the Session ID of the users in DB and then periodically check the validity of session using Session ID and then update status in DB when the session is found invalid.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Not the best solution, in my opinion.

Rather, you can have the user id stored in the session, and use a session listener to know when the session is about to be destoryed.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: How to find wether a session is valid using Session ID.
 
Similar Threads
invalidate others session
Login Page For Jsp
JSP Session and validation
Oracle User Session ID through JDBC API?
Struts2 Save and Get updated List?