aspose file tools*
The moose likes Servlets and the fly likes query on setMaxAge method of Cookie class of servlet api? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "query on setMaxAge method of Cookie class of servlet api?" Watch "query on setMaxAge method of Cookie class of servlet api?" New topic
Author

query on setMaxAge method of Cookie class of servlet api?

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

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

Joined: Jan 10, 2002
Posts: 61766
    
  67

Immediate versus when the browser closes.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

Bear Bibeault wrote:Immediate versus when the browser closes.


Thanks alot Bear Sir
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: query on setMaxAge method of Cookie class of servlet api?