wood burning stoves 2.0*
The moose likes Servlets and the fly likes session timeout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "session timeout" Watch "session timeout" New topic
Author

session timeout

hamlin stephen
Ranch Hand

Joined: Dec 11, 2003
Posts: 45
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!!!
Rishi Tandon
Greenhorn

Joined: Oct 23, 2002
Posts: 17
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 ?


Rishi Tandon<br />SCJP 1.2<br />SCBCD
hamlin stephen
Ranch Hand

Joined: Dec 11, 2003
Posts: 45
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?
Jim Foley
Greenhorn

Joined: Jun 19, 2004
Posts: 1
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.


Jim
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session timeout
 
Similar Threads
time out period defined by the servlet container?
Session
How to change session expiring time of jboss?
what is session expunging?was asked this question in an interview?
session timeout in DD