• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

setMaxInactiveInterval(Int i) does not work?

 
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using WebSphere. The default MaxInactiveInterval seems to be 1800 seconds (verified using session.getMaxInactiveInterval()).
I use setMaxInactiveInterval(36000) to set it to 10 hours. Then session.getMaxInactiveInterval() does return a value of 36000. However 10 to 15 minutes later I get a new session object and session.getMaxInactiveInterval() returns a value of 1800! The browser window never changed.
What’s going on?
Thanks.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
setMaxInactiveInterval is an instance method of HttpSession - when you get a new session you get the default for the server.
Bill
 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which version of WebSphere are you using? I think one of the versions in 3.5 had a bug where this would happen (i.e., it ignored the value you set with HttpSession.setMaxInactiveInterval().
Also, in WebSphere you can set the inactive interval to be something different than the default 30 minutes. Start the WebSphere Admin console, select the Web Application, then select the 'Advanced' tab. Halfway down the page, you will find a 'Session Timeout' property. You can set a specific value here, then tune it without having to change your code.
Final thought. Make sure you are not calling HttpSession.invalidate(). That would clear your session and also the inactive interval you might have previously set.
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
My WAS is 3.5.4 on AS400.
I will try using console.
Bruce
 
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic