How do Websites Use Cookies
A client asked “How do websites use cookies?” and I thought I’d just write an article explaining this in a little more detail since there is no short answer. But the technicality of how it works would require much more detailed explanation.
So what is a cookie anyway? Many people think that cookies are programs which are saved on their computers by websites that they visit, and that these programs can access personal information.
But cookies are not programs and they cannot access your personal information on your computer. Cookies are simply text files that are stored on your computer by a website that you’ve visited.
These cookie files store information to the website you’ve visited. Information such as user id’s, session id’s, a session start time etc. This information is stored so that a website can retrieve it the next time you visit.
For example when you visit a website and sign in, the cookie file it stores on your machine or computer may contain your user-id, session id and the start of the session. Then next time your visit the same website it can access this cookie file and retrieve the data.
A website can only access the cookie file it created on your machine and cannot access cookie files from other websites.
So how do websites use cookies and what do they use them for? Well they use them for many reasons but here are some common ones.
- They help with getting an accurate count of unique visitors versus repeat visitors and how many time a visitor has visited the website.
- They can be useful for sites that allow user customizations like Yahoo and MSN. When you set your user layout the cookies contain some information that helps the website remember this the next time you visit.
- Shopping sites use cookies to store information about your cart, for example when you visit a site and add things to a cart, it stores this information so if you don’t complete the order and come back later your cart is still there. Some sites keep this information only for a period of time and then it expires.
The way that websites use cookies is by storing information from your actions on the website, like what pages you’ve viewed, what products you buy or any information you give via a form on the website.
Most of the information is stored on the websites database and the only thing stored in the cookie file is a unique id that helps the website find the related information in it’s database.
