Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

time out period defined by the servlet container?

 
muthu moorthy
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In HF Book, page 273 Coffee Cram Chapter 6, i found the following question, i have a doubt of the answer provided, answer A, C as showne below.

How "time out period defined by the servlet container" can be correct?

Thank you

Which statement about HttpSession object are true ?
(Choose all that apply)

A. A Session whose time out period has been set to -1 will never expire

C. A session will become invalid after time out period defined by the servlet container
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can specify timeout in web.xml by using


if you specify 0 or negative value in <session-timeout> tag session will never invalidate(never expire).
 
Elan Ram
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi muthu,

there are three ways to define session timeout for any web application.
first is what gowher explained - using DD (in mins).
second by programmer in the code (in seconds) and third by the container vendor. Tomcat container sets the session timeout 30 min only when the above two is not present in the application.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic