• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Variable session timout

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are facing a problem with session timeout. As per requirement we need to have different timeout values for different pages. i.e. to say 40 min for page A and 45 min for page B. Is there any way this configuration can be done. We are using Weblogic9/Java5/Struts1.1.

If you feel this is not the right forum for the question, please let me know.

Thanks!
Bshar
[ August 11, 2006: Message edited by: Bshar ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Servlets forum.
[ August 11, 2006: Message edited by: Merrill Higginson ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bshar,

We're glad you dropped by the Java Ranch. There aren't many rules here, but we do ask that you let us know who you are by giving us your actual first and last names. Please make sure the "publicly displayed name" in your profile meets the JavaRanch naming policy.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can change it at runtime but changing one page will affect them all.
There is only one session object per session.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSession.html#setMaxInactiveInterval(int)
 
S Bhanu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Ben.

I looked into your solution. It works fine

Is it possible to achieve this functionality through some configuration i.e. by putting into an xml file or something so that it can be changed by support team as well. I would not like the jars to be recompiled everytime I make such a change. Any ssuggestions?

Thank you!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bshar,

Our naming policy is not optional.
Please use the link provided by Merrill to fix your screenname.

Accounts with invalid names are subject to deletion.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The session timeout settings in the deployment descriptor are for all pages, not for page A or B. You'll have to make your own configuration file if needed.
 
S Bhanu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ben,
I respect JavaRanch's naming policy and have edited my profile accordingly. I do not know why the chages are not reflecting in my posts!
Regards

Originally posted by Ben Souther:
Bshar,

Our naming policy is not optional.
Please use the link provided by Merrill to fix your screenname.

Accounts with invalid names are subject to deletion.

 
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try HttpSession.getMaxInactiveInterval()
 
S Bhanu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your inputs. I am using HttpSession.getMaxInactiveInterval() now. Any further suggestions are welcome.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sharma Bhanu:
Dear Ben,
I respect JavaRanch's naming policy and have edited my profile accordingly. I do not know why the chages are not reflecting in my posts!
Regards


It gets updated the next time someone writes to it.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want a per-page timeout, you will have to do it with some other mechanism besides the session -- probably JavaScript timers on the various pages.
reply
    Bookmark Topic Watch Topic
  • New Topic