This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

session timeout  RSS feed

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
How can code for session time out in web.xml?
<session-config>
<session-timeout>1</session-timeout>
</session-config> This is not working .
but i can handle it in java code.
i am using tomcatserver
please help!!!
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , i tried out the same thing in Tmcat server, it is working fine.

Do u consider time in seconds specified in web.xml. TheSession timeout which we specify in Deployment Descriptor(web.xml) is spcified in minutes, whereas when we specify it through Java Code (session.setMaxInactiveInterval), it is specified in Seconds.
Does it answer ur question ?
 
hamlin stephen
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank u Rishi,
But actually seconds or minutes that is not the matter.
it is not affecting the session when coding in web.xml.
I am using struts frame work may it cause the problem?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts automatically creates a new session object when sessions time out. So you will always have an active session. To test if your session has really timed out, put some object (for example a user, or a boolean indicating that the session is initialized) in it on your login page. Instead of checking for an active session, check that the object is still available in the session.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!