Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

query on setMaxAge method of Cookie class of servlet api?

 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please refer the url at http://docs.oracle.com/javaee/6/api/javax/servlet/http/Cookie.html#setMaxAge(int)

it says that "negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted".

i did not get the difference between the two. in both cases cookie will be deleted. whats the difference ? Please help
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Immediate versus when the browser closes.
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Immediate versus when the browser closes.


Thanks alot Bear Sir
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic