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 can we achieve transport layer security for our web application?
How do you communicate in between Applets and Servlets?
What is servletconfig?
Difference between java beans & servlets?
What are the uses of servlet and what is servlet chaining?
What is servlet name in web xml?
What are the common methods that are included in the http servlet class?
What is servlet instance?
Can you call a jsp from the servlet?
How we can create war file in servlet?
What's the difference between authentication and authorization?
Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?
What is the difference between genericservlet and httpservlet
Explain the methods of request dispatcher in servlet?
Explain url encoding in servlet?