17 October 2010

0 What is Cookie?

Cookies

   Cookies are some plain text files mainly used for session tracking. A Cookiie is an object created ny server which contains the state information and will be sent to the client browser and will be accepted and stored by browser (Provided Cookies are not disabled at the browser). In otherwords,

Cookies in Java
The class Cookie in the package javax.servlet.http can be used to create a cookie. This java class Cookie has a constructor that takes two string objects as parameters- name and value.

Cookie as a Session tracking Mechanism
Session tracking through HTTP cookies is the most used session tracking mechanism and is required to be supported by all servlet containers. The servlet container sends a cookie to the client. The client will then return the cookie on each subsequent request to the server unambiguously associating the request with a session. The name of the session tracking cookie must be JSESSIONID.

Cookie is a threat to privacy?
A cookie is an object that a server creates and places on the client when the client connects to it. A cookie contains state information. Cookies are valuable for tracking user activities. For example, assume that a user visits an online bookstore. A cookie can save the recent item you visited on that site and other information. So, each time he or she visits the online bookstore, it will be displaying recent item you have visited.
The names and values of cookies are stored on the client machine. Some of the information that is saved includes the cookie’s:
  • Name
  • Value
  • Expiration date
  • path
Advantages of Cookies
  • Cookies are the simplest and most effective of all session tracking mechanisms
  • As cookies are plain text files, they are never interpreted or executed and cannot be used to insert viruses
Disadvantages of Cookies
  • Some browsers doesn't support cookies.
  • Cookies cannot be stored on the client side if the browser has disabled the cookies. So, cookies cannot be used as a session tracking mechanism in such cases.
  • Cookies presents a significant threat to privacy.


0 comments:

Feeds Comments

Please give your valuable comments.