What are first-party and third-party cookies?

Cookies are divided into first-party cookies and third-party cookies. These two types of cookies are files stored on the user’s computer by the website. They are created by a specific domain and can only be accessed by this domain.

Today’s topic is the role of cookies and the classification of cookies. First of all, cookies are an important part of tracking visitor behavior and are indispensable in all detection systems and tracking tools. The original function of cookies is not to track visitor behavior, but to record the visitor’s user information, history, visit preferences, and to determine the login status of old visitors, and to improve the visitor’s experience on the website through this information. Use experience.

For example, new visitors do not need to log in with their username and password every time. When visiting Taobao, they can see the product information of the last browsing. These are all relying on the information stored in cookies. If you clear all cookies in your browser, you will find out how important cookies are when you visit frequently visited websites.

Cookies are divided into first-party cookies and third-party cookies. These two types of cookies are files stored on the user’s computer by the website. They are created by a specific domain and can only be accessed by this domain. We can view the cookies set by websites on us through browsers or third-party tools. The difference between them comes down to what domain name created the cookies.

First party cookies

First-party cookies refer to cookies created by domains visited by web users. For example: when a user clicks on my blog rrdaj.com through a web browser, the browser sends a web page request in the first page, which requires the user to interact directly with rrdaj.com. The web browser then saves this data file on the user’s computer under the “rrdaj.com” domain name.

Most web browsers support first-party cookies.


Because if you disable first-party cookies, websites cannot track your movements as you navigate the web from page to page. Another example: every time you add something to the shopping cart from another page of the shopping site, it will be treated as a new action and not recorded, so you will not be able to buy multiple items online in the same transaction.

Third Party Cookies

Third-party cookies are created on a domain other than the one you visit (the URL in the address bar). For example, advertising networks are the most common source of third-party cookies, and they use them to track user behavior on multiple websites. Of course these activities can be used to adjust advertising. Also images, JavaScript and iframes often lead to the generation of third-party cookies.

Like the recent GDPR, users will not be as friendly to third-party cookies as first-party cookies, and some users will not pay for it.


Because many see it as an invasion of their privacy and a threat to their digital security. (For example: baidu.com in the picture below is a cookie record belonging to a third party)


What are first-party and third-party cookies?
What are first-party and third-party cookies?

For third-party cookies, the most common use is to track users in various fields, especially advertisers. First-party cookies are useful in identifying and tracking users of a single domain.

However, sometimes you want to track users in multiple areas, such as:

(1) You operate a big brand with multiple sub-brands. If you are a relatively large retailer or a food and beverage company or an e-commerce business, you may own multiple brands under the main brand, for example: everyone is familiar with The apparel brand Gap has several sub-brands (GAP, Banana Republic, Old Navy, Piperlime, Athleta), and each sub-brand has its own domain name.

Therefore, it also has its own first-party cookies, which means that the parent company of the main brand www.gap.com cannot use first-party cookies to identify users on other sub-brand websites. In this way, the third-party cookie works, and it can be used to track sub-brands, such as: user behavior under ab-inbev.com, which is convenient for big data management.

(2) The second case is the advertiser I mentioned above, which is easy to understand, such as: Google Adsense, which we are familiar with, through third-party cookies, Google can identify these more than 14 million websites through them (there may be more ) user information, the same is true for many domestic advertising alliances.

So here comes the solution, some users use plugins like AdBlock Plus and NoScript to block things like ads and JavaScript from loading on the site, preventing the creation of third-party cookies. More commonly, or they use to configure their browsing settings so that the web browser blocks or clears them.

Leave a Reply