I need to track the pages user visits and keep them in session.
Here is the detail of my problem:
The user logins(say Session1) and open multiple tabs/windows(say Page1,Page2,Page3) in that session.
When the user logs out Page1 and session ends here. Cookies are deleted at this point.User relogin in Page 1 and then visits the Page2 or Page3 it should be taken to login page. How do I implement this?
I'm not quite sure what you are trying to achieve given your explanation, but it does sound like an investigation of servlet filters will help you out.
I have posted this so that someone who is handling this already in there application could help me.
If you know any solution please provide it. Thanks!
Then you may not be in the right place. JavaRanch is a learning site. If you are here to find someone to do your work for you rather than learning how to do it yourself you will be disappointed.
If you want information to endure past the end of a session, that sounds like a database in called for. That kind of tracking is not something built in to the servlet API.