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
Can you refresh servlet in client and server-side automatically?
What are the steps that are involved in using the httpservlet class?
When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?
What are the different methods involved in the process of session management in servlets?
What are the kinds of http requests?
How do you get the ip address of the client in servlet?
What are the life cycle methods of a servlet?
Is that servlet is pure java object or not?
What is servletconfig?
Write a hello world program using servlets.
What is the difference between 2 types of servlets?
What if we pass negative value in load-on-startup?
Why the concept of single thread model interface is used?
Servlet is pure java object or not?
What's the use of servletcontext?