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

What is the importance of init() method in Servlet ?

1128


Can you explain in detail 'javax.servlet' package?

1039


Explain web application directory arrangement?

1141


What are the objects involved when a servlet receives a call from client?

1091


What is the structure of the http response

1220


What is java servlet?

1108


What is http servlet? Explain with the help of an example.

1114


Can a jsp be called using a servlet?

1199


Explain jsessionid and when is it created?

1186


Why is http protocol called as a stateless protocol?

1082


How the servlet is loaded?

1126


What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?

1332


What is a cookie What is the difference between session and cookie

1140


What are the steps involved in placing a servlet within a package?

1116


What is the difference in between the httpservlet and generic servlet?

1184