I want to get Java HttpSession by JSESSIONID. Is it possible? If yes, how?
I want to get Java HttpSession by JSESSIONID. Is it possible? If yes, how?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ll basically need to manually collect them all in a
Mapusing aHttpSessionListeneryourself.Then, anywhere you want just do
HttpSessionCollector.find(sessionId)to get theHttpSessionin question.That said, this is a huge smell. There are certainly better ways to solve the actual functional requirement than this 😉 As I commented in your follow-up question:
Take it serious. We’re not teasing you, we’re just trying to help you in the right direction to avoid that your project/webapp will break due to security holes and bad practices and/or that you will get fired.