Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What are cookies and how will you use them?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different session tracking techniques?

1246


Why the container loads server at the application startup and how?

1123


What are the phases of servlet life cycle?

1167


Write a program to show the functionality of doget and dopost method?

1260


What do you mean by request dispatcher in servlet? Also explain its methods.

1215


Can servlet have a constructor ?

1100


What are the two important api's in for servlets?

1139


Differentiate between the web server and application server?

1109


Why is init() method is used in servlets?

1082


What are some disadvantages of storing session state in cookies?

1078


What is the default http method in the servlet?

1353


How do you invoke a servelt?

1190


What do you mean by cgi?

1016


What is cookie? Why is cookie used?

1106


Explain how does JSP handle run-time exceptions?

1162