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 the difference between using getSession(true) and getSession(false) methods?
List the Different types of servlet?
What are the annotations used in servlet 3?
What do you mean by deployment descriptor?
What do you mean by web applications?
Whats the advantages using servlets over using CGI?
What is the capacity the doget can send to the server?
How does java thread pool work?
What is cookie? Why is cookie used?
Write a servlet to upload file on server.
What is called a session?
What is the life-cycle of servlets?
Is tomcat a servlet container?
How to get the path of servlet in the server?
Explain in brief the directory structure of a web application?