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 session tracking techniques?

0 Answers  


How to deal with multi-valued parameters in a servlet?

2 Answers  


Explain the custom jsp tags and the beans.

0 Answers  


How do I support both get and post from the same servlet?

0 Answers  


What is the procedure of invoking different servlet in a different application?

0 Answers  






Why do we have servlet listeners?

0 Answers  


hi.... i have problem in running of servlet. i am using Tomcat server in my pc.. The problem is when i am click on strat it will display like below FAIL - Application at context path /first could not be started.. How i can slove the problem.. help plz

3 Answers  


Hello, My project requirement is like I need to create a web page using MVC pattern. I hava a bean class, jsp page, servlet, service and dao. My jsp has two fields. One is dropdown list. The option values has to get populated from the database table. The other one is a text box and its value has to come from database table. As of now I have defined the fields in bean class, got the values from database using arraylists in dao class and I called this from service class. Can anyone please tell me the workflow of how the servlet will get this arraylist and populate the arraylist values as dropdown options in jsp page? Also I would like to know the role of bean class in MVC pattern? Thanks in advance!

0 Answers  


What is the difference between ExecuteUpdate and ExecuteQuery?

4 Answers  


Explain the working of service() method of a servlet.

0 Answers  


What are the type of protocols used in httpservlet?

0 Answers  


What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?

0 Answers  


Categories