A cookie is just a simple text file that usually contains a website address and a unique ID.
By returning a cookie to a web server, the browser provides the server a means of associating the current page view with prior page views in order to ‘remember’ something about the previous page request and events.
An e-commerce site might use a cookie to store information about the purchases a user has made in the past.
When the user returns to the site, the site’s software can retrieve the cookie-based data and use the data to create a custom page that contains products similar to those the user has purchased in the past.
Cookie comes in two minor variations: session cookies and persistent cookies.
Session cookies last only as long as the visitor in the site and are deleted after the user closes her web browser or after some period of inactivity.
Persistent cookies last beyond a single visit and have an expiration date sometime in the future.
Cookies are extremely limited in size. Generally, only about 4kb of data can be set in a cookie, meaning they are unacceptable for large values such as documents or mail.
Cookies provide a great service to web measurement application, allowing unique visitors to be tracked from visit to visit and enabling valuable measurements like frequency of visit and lifetime value.
Web cookies can improve data accuracy