What are cookies and how will you use them?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different Authentication options available in Servlets.

657


How to handle exceptions thrown by application with another servlet?

695


Explain how does JSP handle run-time exceptions?

664


What is ServletContext object?

730


Why do we have servlet wrapper classes?

665






What is servlet in simple terms?

656


What do you mean by web applications?

722


How do you design microservices?

699


Which protocol will be used by browser and servlet to communicate

663


What are Servlets?

698


Is that servlet is pure java object or not?

716


Differentiate between the web server and application server?

654


Can filter be used as request or response?

623


What is MIME Type?

736


Explain the difference between a web server and a web container?

599