Software Programmer
asked on
Retrieve and Invalidate Session using session id
We are storing all the HttpRequest session id in the table. Assume 100 users are active in an application.
If i query the table, i will get all the session ids.
1. How to load the corresponding HttpRequestSession using the id ??
2. How to invalidate few session based on the user details ??
If i query the table, i will get all the session ids.
1. How to load the corresponding HttpRequestSession using the id ??
2. How to invalidate few session based on the user details ??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
mysql tableThat is different. You can't put a HttpSession reference in there. I am suggesting you use an application-scoped Hashtable.
ASKER
When the sessionDestroyed will get executed ?? How to access the session throughout the application which is being set in hashtable so that to make it invalidate ???
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How about using Spring Security Context and get all the principal objects and retrieve the session and invalidate it? Is it safe to use it or right way to invalidate the other user's session in terms of security ?
I don't use Spring.
ASKER
Please kindly re-route this question to a spring expert for an answer.
You can add the appropriate Spring tag yourself. Go to top and click on tag edit button.
ASKER
I'm unable to add the spring tag from the beginning. it always throws error - "Please select at least one approved topic."
I guess you should ask a moderator.
ASKER
Rrz is correct..We can close this question..This has been resolved.
ASKER