Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • 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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!