Link to home
Start Free TrialLog in
Avatar of mytilig
mytilig

asked on

Session Timeout issue

I want to set my session timeout to 8 hours.  I am using SunOne webserver.

In my JSP, I have  session.setMaxInactiveInterval(60*60*8);
But my session seems to get timed out in less than 30 minutes.

I tried to print session.getMaxInactiveInterval and it does print 28800(60*60*8) but for some reason session gets invalidated in about 30 minutes. any thoughts?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of bloodredsun
bloodredsun
Flag of Australia image

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 gksinghiet
gksinghiet

Yes bloodredsun is right you can set the sessin timeout time in web.xml as:

<session-config>
  <session-timeout>480</session-timeout>
</session-config>
Here the value of session-timeout tag is timeout for a session in minutes.
Avatar of mytilig

ASKER

I have removed the session.setMaxInactiveInterval(60*60*8);  from my code and added this to my web.xml
<session-config>
            <session-timeout>720 </session-timeout>    
    </session-config>

(I want the session to time out after 12 hours.)

The application still seems to be getting timed out after the 1st hour before the 2nd hour. I print session.getMaxInactiveInterval() in my main JSP page, and it prints 43200 (720*60), so I am inclined to believe it is reading web.xml correctly.
Wondering why it still times out quickly?
Thanks.
How are you measuring session timeout interval?
Seems there might be bug in few of the web servers.
Refer:
http://www.jguru.com/faq/view.jsp?EID=525564
Avatar of mytilig

ASKER

I have sunone 6.1 webserver. The doc says timeout should be given in minutes within web.xml
When I specify it as 720 and execute my code to print sessiontimeout, it prints 43200 (720*60)
Thank you.