cookies are small, plain-text data files that live somewhere on your computer (exactly where depends on the web browser). Cookies are written to your computer by your web browser responding to commands from a website. A website can write multiple cookies, but (barring software bugs) can only see the cookies they wrote.
Cookies are categorized two ways: according to their lifespan and where they came from.
- LIFESPAN
Short-lived cookies exist only for the current web browser session. When you close your browser, all such cookies go away. Not surprisingly, these are called session cookies (the IE7 help pages also refer to them as temporary cookies). For tracking purposes, session cookies pose no danger.
The majority of cookies are more permanent. It's not unusual for a website to set the expiration date of a cookie to be 10, 20 or 30 years in the future. These persistent cookies (that's the official name) can be very beneficial, but they can also be used for behavior tracking. If a website has ever remembered your userid/password, you have a persistent cookie to thank for the convenience.
- ORIGIN
When it comes to the origin of a cookie, there are two categories: first party and third party.
First party cookies come from the website whose domain name is displayed in the address bar of your web browser. For example, at the web site of my home town newspaper, The New York Times, first party cookies are set by the newspaper.
But a web page is normally made up of many pieces and the pieces don't have to come from the same website. The ads, for example, rarely originate on the website you are visiting. Cookies that come from these third party advertising networks are the origin of the term "third party cookies", which refers to cookies set by websites you had no intention of visiting.