• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Am I correct ???

 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpSession.setMaxInactiveInterval(0) --- Times Out Immediately
HttpSession.setMaxInactiveInterval(-1) -- Never Times Out
<session-config>
<session-timeout>0/-1</session-timeout> -- Never Times Out
</session-config>

Cookes.setMaxAge(-1) -- times out when browser exists

Cookes.setMaxAge(0) -- ??? :roll:
 
Gabriel Forro
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Yes, you are right and the answer for the last question is a quotation from the Servlet API:



A zero value causes the cookie to be deleted.


It means, it is deleted on the client side, if there is any cookie on the client side named as the cookie object, you invoked the setMaxAge(...) on.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic