A cookie may be generally defined as a small piece of text. A cookie is normally stored on the computer of a user with the help of a web browser. One or more name value pairs are contained in a cookie. These pairs generally contain bits of information. The information may be associated with the preferences of the user, data used by certain websites, etc. Yet other type of information that may be contained includes shopping cart contents, the server-based session identifier, etc.
A cookie is transferred as an HTTP header. Generally it is transferred to a web browser and this transfer happens through a web server. The different uses of a cookie can be linked to authentication, tracking of session, for remembering specific information on the users.
In addition to the name/value pair, a cookie also contains a path, a domain name, an expiration date. Additionally, it is also specified that whether the cookie is intended only for encrypted connections.
The identification of cookies is generally done by a combination of their name, path, domain name, etc. in cookies and not just by their name alone. Therefore, the cookie values are changed only if there is a new value attached with the cookie name, path or the domain name.


