How to check which existing session is valid or which is invalid
Hi forum,
In my application i am maintaining collection( In this collection i am maintaining user ID and session ID) of session id's which are active and deleting those session id's from the collection which user logs out. when user is inactive for a while and his session made invalidate. but in my collection these session id's still exists. My concern is how can i check in available collection which session's are valid and which are not.
Please help me to come out from this problem.
Thanks.
[525 byte] By [
boyasha] at [2007-11-27 6:08:38]

# 1
Check out the HttpSessionBindingListener. You can implement this on some sort of user bean you use to keep track of your user. With the valueUnbound method you can know when this bean is removed from the session, which will be when the session drops. In this method you can remove your sessionId from the collection.
# 2
Yes gimbal2, Through valueUnbound method i tried to get session ID which are going to invalidate. To implement this i am invoking method setDeletedSessionID(String sessionID) from valueUnbound . But the control is not reaching to this method ( setDeletedSessionID() ) there and session get invalidated.
Will u please describe your views in sort of code flow, Since i think i have tried with many ways but not able to get that, And i am in need to complete it asap otherwise i would do more experiment.
Thanks