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 / janet

Cookies are a mechanism that a servlet uses to have a
client hold a small amount of state-information associated
with the user.
a) create a cookie with the cookie constructor:
public Cookie(String name,String value)
b) A Servlet can send a cookie to the client by passing a
Cookie object to the addCookie() method of
HttpServletResponse:
public void HttpServletResponse.addCookie(Cookie
cookie)

c) A servlet retrieves cookie by calling the getCookies()
method of HttpServletRequest:
public Cookie[]HttpServletRequest.getCookie().

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which interface must be implemented by all servlets?

1418


What is the difference between servlet and filter?

1006


Is servlet synchronized?

1137


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

1219


Can you create a deadlock condition on a servlet?

1128


How is the get () method different from the post() method?

1040


Which event is fired at the time of project deployment and undeployment?

1373


Can you call a jsp from the servlet?

1071


Define the lifecycle for executing a jsp page.

1142


What is the GenericServlet class?

1297


What is servlet container. how it works?

1178


Difference between forward() method and sendredirect() method ?

1094


What are the different methods of session management in servlets?

1082


What is ServletConfig object?

1256


What is string tokenizer?

1144