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.
mytiligAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bloodredsunCommented:
You should really be setting your session timeouts in the web.xml

Why do you need a 8 hour session? Remember that a session expires a set time after the last recorded request from that user, not from the start of that session.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gksinghietCommented:
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.
mytiligAuthor Commented:
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.
gksinghietCommented:
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
mytiligAuthor Commented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.