File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Save Logout time in database
Joined: Oct 07, 2008
Dec 14, 2009 05:13:15
I am storing the login and logout time in database.
When the user login i am calling the DAO object at that time and inserting in database.
But for log out time i am using session listener.
In side the method
public void sessionDestroyed(
i am updating the log out time by comparing the session id and date .
like this : update acces_log set log_out_time =? where session_id=session.getID and date =Date;;
Is this the right way to do this.
Please tell me.
Joined: Feb 24, 2006
Dec 14, 2009 21:25:55
It might now always be accurate since a user might not actually use the logout button. The user could close the browser and walk away. Is it all right if your session times out after the timeout time set in web.xml ?
SCJP 6 articles
SCJP 5/6 mock exams
More SCJP Mocks
I agree. Here's the link:
subject: Save Logout time in database
Regarding JDBC concept
Problem with SessionId
Clear session on Browser Close
Browser Closing without signout from site
need to call a function before Session ends
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014