Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Why setMaxAge() and getMaxAge() methods are used in Cookies?

Answer Posted / tulasi vani

Cookies are created as

Cookie c=new Cookie(name,value);
c.setMaxAge(milliseconds);

int getMaxAge() returns the maximum age of the cookie.

If the value is set to zero it will be deleted
immediately.If the age is a -ve number it states that the
age of the cookie is confined to that particular request
only.

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a server side include (ssi)

1138


If servlet receives multiple requests, how many objects will it create?

1370


What is the difference between the http servlet and generic servlet?

1129


What is new in ServletRequest interface ? (Servlet 2.4)

997


How to create war file?

1148


What do you mean by request dispatcher in servlet? Also explain its methods.

1139


What is servlet and its use?

1095


What is the effective way to make sure all the servlets are accessible only when user has a valid session?

1044


What is the inter-servlet communication?

1161


What is the difference between context parameter and context attribute?

1029


What are the advantages of cookies?

1114


How do you find out what client machine is making a request to your servlet

1046


What is the element?

1040


Explain the difference between a web server and a web container?

987


What is Servlet API used for connecting database?

1088