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
how the HTML data stored in web server?
What is the life cycle of a servlet?
What is java servlet?
Which interface should be implemented by all servlets?
Explain jsessionid and when is it created?
Can we override destroy method in servlet?
What is the difference between sendredirect() and forward() in a servlet?
hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code
Why filter is used in servlet?
What do you mean by request dispatcher in servlet? Also explain its methods.
How we can create war file in servlet?
How we can call a jsp from the servlet?
Why do we have servlet listeners?
What are the functions of the servlet container?
How many objects of a servlet is created?