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

Name the webserver that is used to run Servlets?

5 Answers  


Hi............ When i am started the tomcat server it started. but it not load the jar files wht we deploving file.suppose we load the wapp folder in webapps. At running time it show the below error in tomcat server INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.0\web apps\wapp\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, s ection 9.7.2. Offending class: javax/servlet/Servlet.class How to slove this problem in my system. plz give answer for this problem.

5 Answers  


List the Different types of servlet?

0 Answers  


What is the directory structure of web application?

0 Answers  


Explain in detail about applet to servlet communication?

1 Answers  






How does java thread pool work?

0 Answers  


How to rectify errors in java servlet while compilation?

0 Answers  


What are Servlets?

0 Answers  


What is context in servlet?

0 Answers  


How can we perform any action at the time of deploying the project?

0 Answers  


Is JSP Thread Safe ???? How To make JSP thrad safe ?????

6 Answers   Cognizant,


What is the procedure for initializing a servlet?

0 Answers  


Categories