[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Session Timeout issue

Posted on 2006-04-06
5
Medium Priority
?
1,335 Views
Last Modified: 2012-06-21
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.
0
Comment
Question by:mytilig
  • 2
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
bloodredsun earned 2000 total points
ID: 16396738
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.
0
 
LVL 5

Expert Comment

by:gksinghiet
ID: 16398283
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.
0
 

Author Comment

by:mytilig
ID: 16423727
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.
0
 
LVL 5

Expert Comment

by:gksinghiet
ID: 16426502
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
0
 

Author Comment

by:mytilig
ID: 16443392
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.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I came across an unsolved Outlook issue and here is my solution.
Most folks would know the basics of how Dropbox works, so that’s not the purpose of this article. Security is what it’s all about, so here I’ll share how I choose to secure my Dropbox Account and the Data it contains.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Screencast - Getting to Know the Pipeline
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question