Answer Posted / sandeep m
Cookie is a key value pair stored by server at client side
for session tracking any other related use.
Cookie class is available in javax.servlet.http package.
cookies can be retrieved from
javax.servlet.http.HttpServletRequest object using
getCookies() method.
getCookies() returns Cookie[] array object. Any number of
Cookies can be stored on response object.
cookie can be added to
javax.servlet.http.HttpServletResponse object. using
resp.addCookie(new Cookie("key","value"));
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the different session tracking techniques?
Why the container loads server at the application startup and how?
What are the phases of servlet life cycle?
Write a program to show the functionality of doget and dopost method?
What do you mean by request dispatcher in servlet? Also explain its methods.
Can servlet have a constructor ?
What are the two important api's in for servlets?
Differentiate between the web server and application server?
Why is init() method is used in servlets?
What are some disadvantages of storing session state in cookies?
What is the default http method in the servlet?
How do you invoke a servelt?
What do you mean by cgi?
What is cookie? Why is cookie used?
Explain how does JSP handle run-time exceptions?