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 / abhijitbaji

setMaxAge(), this function sets the maximum age of the
cookie.
The value of the maximum age is the lifetime of the cookie
in seconds.
It is a decimal non-negative integer.
When the age is greater than seconds of maximum age, the
client SHOULD discard the cookie.
A value of zero means the cookie SHOULD be discarded
immediately.


getMaxAge(), this function can be used to retrieve the
maximum age of the cookie.

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between context parameter and context attribute?

1022


Define servlet mapping?

1144


How do you invoke a Servlet? What is the difference between doPost method and doGet method?

1122


Differentiate between the get and post method

1042


How do we call one servlet from another servlet?

1018


What's the advantages using servlets than using cgi?

985


Define the lifecycle for executing a jsp page.

1064


Which protocol will be used by browser and servlet to communicate

1039


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

1124


What is api in servlet?

1006


What is the directory structure of a war file?

1153


What is Request Dispatcher?

1413


How do you communicate in between Applets and Servlets?

1048


Which event is fired at the time of project deployment and undeployment?

1307


What is a web application and what is it’s directory structure?

1065