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
What is a server side include (ssi)
If servlet receives multiple requests, how many objects will it create?
What is the difference between the http servlet and generic servlet?
What is new in ServletRequest interface ? (Servlet 2.4)
How to create war file?
What do you mean by request dispatcher in servlet? Also explain its methods.
What is servlet and its use?
What is the effective way to make sure all the servlets are accessible only when user has a valid session?
What is the inter-servlet communication?
What is the difference between context parameter and context attribute?
What are the advantages of cookies?
How do you find out what client machine is making a request to your servlet
What is the
Explain the difference between a web server and a web container?
What is Servlet API used for connecting database?