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 does the term localization refer to?
Does servlet have main method?
Explain the war file?
Can we use the constructor, instead of init(), to initialize servlet?
Why is Servlet so popular?
What is httpservlet class?
What is servlet container?
What is a servlet context?
What are the types of protocols supported by httpservlet ?
What are the different types of servlets?
Explain in brief the directory structure of a web application?
Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?
What is servlet lazy loading?
What is the requirement of servlet config and servlet context implemented and how are they implemented?
What are all the advantages of servlet over cgi?