Pergunta de entrevista da empresa Google

How can a site not access cookies stored by another site?

Resposta da entrevista

Sigiloso

12 de set. de 2019

Ordinarily, websites can't read cookies other than the ones they've left themselves for security reasons.However, Ad-companies started displaying ads on sites depending on the content of the page. So, if you are a webmaster, you add a line of JavaScript code and a neat looking advertisement is displayed on your site page. Inorder to track you, as you moved from one site to another (both displaying sites ads from the same ad-company), the companies need to store cookies.When a user visits siteA.com, a cookie is not only set for siteA.com but also for a common domain which is accessed by all sites that use the ad-company’s code. Thus, siteA.com, siteB.com and all other sites displaying ads from adsite.com, store and access the same third-party cookie.

2