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 the difference between using getSession(true) and getSession(false) methods?

989


List the Different types of servlet?

985


What are the annotations used in servlet 3?

997


What do you mean by deployment descriptor?

963


What do you mean by web applications?

1121


Whats the advantages using servlets over using CGI?

1008


What is the capacity the doget can send to the server?

1019


How does java thread pool work?

1023


What is cookie? Why is cookie used?

1010


Write a servlet to upload file on server.

1038


What is called a session?

1118


What is the life-cycle of servlets?

1094


Is tomcat a servlet container?

983


How to get the path of servlet in the server?

948


Explain in brief the directory structure of a web application?

1055