• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Variable session timout

 
S Bhanu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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 ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Rusty Smythe
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try HttpSession.getMaxInactiveInterval()
 
S Bhanu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic