What are cookies and how will you use them?

Answers were Sorted based on User's Feedback



What are cookies and how will you use them?..

Answer / ravikiran.chd

cookies are the small server side components,which are used
to transfer small amount of client data

Is This Answer Correct ?    2 Yes 1 No

What are cookies and how will you use them?..

Answer / 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

What are cookies and how will you use them?..

Answer / usha

cookie is small piece of data set by the server on the
client ,for session tracking. When the server sets the
cookie as part of the response,the client will send the
cookie back to the server when it sends the next request.

Cookie is class in http package.Create Cookie object and
send it as part of response using
response.addCookie(cookie object)
can access the cookie using
request.getCookie();

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Servlets Interview Questions

What compiler do not do if we create our own constructor?

5 Answers   HCL,


Why is http protocol called as a stateless protocol?

0 Answers  


What do you mean by filter in servlet?

0 Answers  


How can the referrer and the target urls be used in servlet?

0 Answers  


i am bca student,give me suggest for bright future

18 Answers   BSNL, Future Considerations,






What are the types of ServletEngines?

1 Answers  


What is a parser. What does a parser do with a XML? Why do we need it?

1 Answers  


When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?

0 Answers  


Explain in detail about applet to servlet communication?

1 Answers  


What are the parameters of the service method ?

2 Answers  


Whats the advantages using servlets over using CGI?

0 Answers  


What are the functions of the servlet container?

0 Answers  


Categories