• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Timeout and SCWCD kit question

 
John Lincoln
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In chapter 8 of SCWCD kit, there is a question, if you don't want your web application session not to time-out ever what you would do ?

Answer is set the session-timeout to 0 or -1 in DD. But i think it should be only -1 not 0.

Please help

Thanks
 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spookily, I just looked up that very same thing in the specs.

I'm still a little unsure...

If setting <session-timeout> in DD, the spec says
"If the timeout is 0 or less, the container ensures the default behaviour of sessions is never to time out. If this element is not specified, the container must set its default timeout period."

However, for setting it programatically, it just says
"By definition, if the timeout
period for a session is set to -1, the session will never expire."
No mention of 0.
HFSJ p247 has an example where it sets it to 0 and says "causing the session to timeout immediately".

Would appreciate clarification on this.

MG
 
Saurabh Kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Setting Session Timeout in DD:

0: session never expires.
-1(negative value): session never expires.
value greater than 0: session expires after that value.


Setting Session timeout programatically:

0: session expires immediately.
-1(negative value): session never expires.
value greater than 0: session expires after that value.

Hope this helps.

Thanks and regards,
Saurabh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic