How do Third-Party “tracking cookies” work?

前端 未结 1 1272
我寻月下人不归
我寻月下人不归 2020-12-07 07:29

I have read this question here: How Do Internet Advertisers Use Third-Party Cookies? on how third-party tracking cookies work, but am still very confused. I don\'t understa

1条回答
  •  天涯浪人
    2020-12-07 08:11

    First, cookies are set and retrieved through HTTP headers. If your browser sends a request to http://example.com, then the response might come back with a header that says Set-Cookie: foo=bar. Your browser stores this cookie, and on any subsequent requests to http://example.com, your browser will send foo=bar in the Cookie header. (Or at least until the cookie expires or is deleted.) The browser sends the foo=bar cookie with any request to http://example.com, regardless of who initiated the request or what the context is. If http://example2.com contains the tag , then the browser will send the cookie foo=bar when it fetches http://example.com/img.jpg, even though http://example2.com is responsible for the request being sent.

    So, if website A contains an ad that is served by website B, then website B can set a cookie in your browser. For example, maybe website A uses