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

Why session tracking is needed?

580


Where do you define dispatcherservlet?

550


Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?

614


Which interface must be implemented by all servlets?

791


How can a servlet be used to generate plain text instead of html?

541






Explain is servlet mapping?

576


What is the difference between 2 types of servlets?

642


How can you push data from an Applet to a Servlet?

605


What is a servlet?

608


How the servlet is loaded?

597


What is dispatcher servlet?

553


What is the element?

585


What do you mean by web applications?

625


What are the types of an http request?

581


What are the different types of servlets?

514