Link to home
Start Free TrialLog in
Avatar of vi_srikanth
vi_srikanth

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of a_b
a_b

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sathish David  Kumar N
Avatar of vi_srikanth
vi_srikanth

ASKER

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.