• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2881
  • Last Modified:

Configure session timeout for JSF managed bean

Hi

I am a newbie to JSF. I had created a managed bean, and made its scope as session. It works well, and I am able to retrieve all the values stored in that managed bean. However, I dont know how to control the session timeout. Basically, I have two related questions:

1. Could you please help in setting up a timeout for a session? For e.g., is it possible to set the session timeout for the managed bean as 30 minutes?

2. Also, the cookie which maintains the JSF session id expires the moment browser is closed. Is it possible to have the cookie expiry set to the same timeout as set for the corresponding session? This way no matter whether the browser is closed or not, the cookie will live as per its timeout/expiry.

Thanks
Srikanth
0
vi_srikanth
Asked:
vi_srikanth
  • 2
2 Solutions
 
a_bCommented:
0
 
a_bCommented:
For the second issue I am nit sure of the solution but try using the cookie.setMasAge() method. That looks promising.
0
 
Sathish David Kumar NArchitectCommented:
0
 
vi_srikanthAuthor Commented:
Thanks for the replies. I am particularly interested in the second question. Anyway I hope that as per the suggestion above, the cookie.maxAge() might work. I will try out that.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now