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
What is the use of servlet wrapper classes?
Explain the architechure of a servlet?
What do you mean by mime type?
How to notify an object in session when session is invalidated or timed-out?
What is the workflow of a servlet?
why we should override only no-agrs init() method.
Why is servlet used?
What do you mean by filter in servlet?
What is Request Dispatcher?
How can we achieve transport layer security for our web application?
Whats the advantages using servlets over using CGI?
What is the difference between Server and Container?
What is the process to implement doget and dopost methods?
If my browser does not support cookie, and my server sends a cookie instance what will happen?
What do you mean by annotations in servlet?