Answer Posted / balakrishna
cookie is a"small amount of data" that is set by the server
on the client.
we have setmaxAge() for destroy cookie.
1.cookie.setMaxAge(100)-->100 sec
If we set the max age of a cookie to 100 sec,the browser
holds the cookie for 100 sec even if we close the browser.
2.If we set max age value to negative value the browser hold
the cookie till we close the browser.
3.If we use setMaxAge(0) the browser will arase the cookie.
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
What mechanisms are used by a Servlet Container to maintain session information?
What are the different ways we can maintain state between requests?
How can the session in servlet can be destroyed?
Tell the new features added in servletrequest interface i.e. Servlet 2.4
What are the key methods that are involved in processing of http servlets?
What is the difference between servlet and jsp?
What is the difference between Difference between doGet() and doPost()?
Explain the difference between servlet and cgi?
What is the difference between context parameter and context attribute?
What is httpservlet and how it is different from genericservlet?
What is the use of java servlet api?
What are the various ways of session supervision in servlets?
Who is responsible for writing a constructor?
What are the exceptions thrown by servlets? Why?
What are the uses of servlet and what is servlet chaining?