An HTTP cookie (also called web cookie, Internet cookie, browser cookie, or simply cookie) is a small piece of data sent from a website and stored on the user's computer by the user's web browser while the user is browsing. Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items added in the shopping cart in an online store) or to record the user's browsing activity (including clicking particular buttons, logging in, or recording which pages were visited in the past). They can also be used to remember arbitrary pieces of information that the user previously entered into form fields such as names, addresses, passwords, and credit card numbers.
Cookies can be accessed by any webpage if cross-site cookies are enabled in the browser, even if the website accessing the cookies is not the owner. In laymen's terms, this means Facebook can see your purchases from Amazon by reading your cookies. This can pose as a security and privacy risk so certain browsers now disable cross-site cookies by default.