I am polling to a servlet which results in “No Session Time Out”. Is there any way to time out session while polling?
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 could put the sessionId (key) and timestamp (value) in a static HashMap on creation (indicated by
session.isNew()).And check during polling in your servlet whether you want to time out the session, which
could be performed by invoking
session.invalidate()http://download-llnw.oracle.com/javaee/1.2.1/api/javax/servlet/http/HttpSession.html#invalidate%28%29