Kewei Shang
Kewei Shang

Reputation: 983

How can third party cookies know which sits a user have visited?

I did a quick search on "third party cookies". As far as I know, a cookie can only be sent back to it's own domain (and path) by the browser via the HTTP request.

For example, I'm visiting the website A who contains an image from an advertising website B. My browser sees the url of the image and makes a HTTP request for that image to the website B. The website B get that HTTP request and set cookies in the HTTP response "Set-Cookie: user=arandomstring". There my browser now contains cookies from the website A and a cookie named "user" from the website B. The next time when I go to another website C who also contains an image from the same advertising website B, the website B would only get the "user" cookie set by himself. am I right? How can website B knows which websites (website A) have I visited in order to display his customized adverts?

Upvotes: 1

Views: 579

Answers (1)

Niko
Niko

Reputation: 26730

The easiest and most common way is to pass information about the site the request was made for as a parameter, e.g. <img src="http://server-b.com/img.jpg?server=A">

Another solution is to get this information from the "Referer" header. However, this method will not work for every visitor since this header can be disabled in most browsers.

Upvotes: 1

Related Questions