Its as simple as putting the user name in session.
Joined: Aug 16, 2005
hi, thanks for your reply. I am using the session like this only to keep track of username. But if user updates anything in that page it is not getting reflected in the page. And also if another user logs-in and the user is getting the first logged in user's page.If the user refresh the page,it is showing the current user'spage. How to avoid reflection?I tried by setting maxInactiveinterval to the session object.It is also not working. I want to know the proper way to track session object.In what way the setMaxInactiveInterval will help me in avoiding this reflection?
The Page where you want the user to logout , does it terminate the session on that page ? i.e are you invalidating the session ? Because if the session timeout period has not got ended and the user just closes the browser , the server DOES NOT terminate the session and then someone again opens the same page the previous user was browsing , then he / she can definately see what the previous user was indeed seeing.
So , Its better to invalidate the session and forward the user to login page once session has expunged.
You can check the HttpSession interface for more details on this.
Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....