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
How do you design microservices?
Explain the methods of request dispatcher in servlet?
What are the disadvantages of storing session state in cookies?
What are the new features added to servlet 2.5?
Write a command to get actual path of a servlet to the server?
What are the difference between RMI and Servlets?
When to use doget() and when dopost()?
Describe the phases of servlet lifecycle?
Differentiate between the print writer and servlet output stream?
Explain servlet.
Why the concept of single thread model interface is used?
What is the use of servlet wrapper classes?
What’s the use of the servlet wrapper classes??
Why HttpServlet class is declared abstract?
What is the difference between servlet and filter?