[jboss-user] [JBoss Portal] - Session - setMaxInactiveInterval : how to get it work?

chuaky do-not-reply at jboss.com
Tue Dec 9 05:37:17 EST 2008


Greetings,

I was developing some apps on JBOSS portal, and there are some cases that need to have a much longer session timeout value that the default value in web.xml.

So, i go about trying to change the session timeout value using setMaxInactiveInterval().  But i notice that the effective session timeout is still the original default value in web.xml in my deployed apps.


The 2 sets of not working code that i had tried are as follows:


  | int regularSessionTimeout = ServletContexts.getInstance().getRequest().getSession().getMaxInactiveInterval();
  | log.info("MaxInactiveInterval = " + regularSessionTimeout);
  | ServletContexts.getInstance().getRequest().getSession().setMaxInactiveInterval(12000);
  | 


  | HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
  | log.info("MaxInactiveInterval = " + session.getMaxInactiveInterval());
  | session.setMaxInactiveInterval(12000); 
  | 

>From the logging, it shows that the session timeout was changed to the new value, but the session still effectively timeout at the old timeout value.

My old value was 1200 seconds (20 minutes)
New value is 12000 seconds.


Any advise would be most appreciated.

My system settings are:

- Jboss Portal 2.6.5
- Richfaces 3.2.2
- Seam 2.1.0SP1

Thank you.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4195279#4195279

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4195279



More information about the jboss-user mailing list