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
Is servlet thread safe?
Explain mvc pattern.
Describe in brief RequestDespatcher?
Should I override the service() method?
What is servlet used for?
How to find whether a parameter exists in the request object?
In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify
What is a web container and what is its responsibility?
When a client request is sent to the servlet container, how does the container choose which servlet to invoke?
What is difference between server and servlet?
Why servlet is faster than jsp?
How do you load an image in a Servlet?
What are the exceptions thrown by servlets? Why?
What are the different methods involved in generic servlet?
What are the disadvantages of storing session state in cookies?