What is a cookie?

Updated: Tuesday, June 25, 2024

A cookie is a piece of information in text format in the form of a key: value pair that is stored in your browser by a server or by the browser itself. This works in the same way on all your devices, whether you’re using a computer, tablet or cell phone.

For example, when you connect to facebook.com, Facebook’s servers will deposit cookies in your browser:

Cookies dropped by the server that responded to the facebook.com request
Cookies dropped by the server that responded to the https://facebook.com request

Cookies deposited by the server that responded to the request https://facebook.com

Here, for example, the key wd corresponds to the size of my browser and locale to the language I chose on the social network.

If we take a closer look at the request sent to Facebook to load the site, we can clearly see where the server tells the browser to store these cookies and their values:

The HTTP response containing the cookies to be stored by the browser
The HTTP response containing the cookies to be stored by the browser

Native (or first-party) cookies

Native (or first-party) cookies are used to enhance the user experience and/or analyze user behavior on a website.

They are used to keep you logged in to your member area, or to save your shopping cart so you can return to it later. If you had to re-enter your Facebook login each time, it would severely degrade your experience.

That’s what native cookies were originally created for, and they enable the servers to “remember” you.

In the example above, we only have native cookies because the domain of the server that set the cookies is the same as the site I’m currently on facebook.com.

Third-party cookies

Now we come to the interesting part: third-party cookies. These cookies enable advertising platforms (Google Ads, Facebook, Twitter, Instagram, LinkedIn) to track your activity on the web.

Advertising platforms aren’t the only players to use third-party cookies, however. You also have analytics tools like Google Analytics or Hotjar, for example.

The main difference with a native cookie is that a third-party cookie can track your activity across several websites.

This is particularly interesting for advertising platforms, as they can build up an anonymous user profile based on your browsing habits, and thus offer you personalized advertising.

Didn't find what your were looking for?

Get help from the Data Marketing Club

Join the club