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 are the different methods involved in the process of session management in servlets?

0 Answers  


Servlet Chaining? How do you do the Filtering in Servlets?

6 Answers   HCL,


Explain the methods of request dispatcher in servlet?

0 Answers  


Where do you define dispatcherservlet?

0 Answers  


How many objects of a servlet is created?

0 Answers  






What are the mechanisms used by a servlet container for maintaining session information?

0 Answers  


How can we refresh automatically when new data has entered the database?

0 Answers  


Difference between forward() method and sendredirect() method ?

0 Answers  


What is the difference between Server and Container?

0 Answers  


Why session tracking is needed?

0 Answers  


what is multiple server?

0 Answers  


What is servlet and its life cycle?

0 Answers  


Categories