I have a JSF app and would like to have the user auto logout after a period of inactivity. Is there an standard way to do this?
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.
Generally, the server (Tomcat, Glassfish…) that hosts the web application handles a timeout for a session.
For example, in Tomcat, you can define the session timeout for a particular web application by adding the folowing lines in the
web.xmlfile:This will set the timeout to 30 minutes.
When a user does not send any request during a time greater that this defined timeout, the session on the server is invalidated. If the user tries to reconnect after the session has been invalidated, he will generally be redirected to another page or to an error page.
You can develop your own JSF Filter that will automatically redirect the user to a
timeout.htmlpage. Here is an example of such a filter :