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

How do you design microservices?

1095


Explain the methods of request dispatcher in servlet?

1053


What are the disadvantages of storing session state in cookies?

1154


What are the new features added to servlet 2.5?

1103


Write a command to get actual path of a servlet to the server?

1037


What are the difference between RMI and Servlets?

1572


When to use doget() and when dopost()?

1125


Describe the phases of servlet lifecycle?

1072


Differentiate between the print writer and servlet output stream?

998


Explain servlet.

1050


Why the concept of single thread model interface is used?

1003


What is the use of servlet wrapper classes?

1189


What’s the use of the servlet wrapper classes??

1107


Why HttpServlet class is declared abstract?

1225


What is the difference between servlet and filter?

959