Types of Computer Cookies: First-Party vs. Third-Party Cookies

Learn about the two main types of computer cookies, first-party and third-party cookies. One aims to help improve your web browsing experience, while the other is for tracking and targeted advertising.
We receive compensation from the products and services mentioned in this story, but the opinions are the author's own. Compensation may impact where offers appear. We have not included all available products or offers. Learn more about how we make money and our editorial policies.

Cookies are very small — and occasionally encrypted — files that get stored on your browser as you surf the web. Internet users should know of two main types of computer cookies: first-party and third-party cookies. Whereas first-party cookies aim to personalize and improve your browsing experience on a particular website, third-party cookies track you across the web to feed your cookie profile to advertisers.

Here's how to tell the difference between first and third-party cookies.

4.9
Ad Blocker
Total Adblock
  • Instantly blocks distracting ads on millions of websites, including Facebook and YouTube ads
  • Blocks third-party trackers to protect your privacy and information
  • Improves page load times and enables faster browsing
Learn More

In this article
First-party cookies
Third-party cookies
Session cookies
Persistent cookies
Bottom line

First-party cookies

First-party cookies come from websites that you directly visit in your browser. They're used to improve your online user experience of each particular website. First-party cookies often store information relevant to the website you're visiting, such as what you’ve viewed in the past or your settings preferences.

As long as you visit authentic and reputable websites, first-party cookies are usually harmless and make it easier to browse your favorite websites. They do, however, track your activity only on that website

Examples of first-party cookies

  • User authentication cookies
  • Language preference cookies
  • Session cookies
  • Site preferences cookies
  • Website analytics cookies
  • Online shopping cart cookies
  • Autofill form cookies
  • Security cookies
  • Accessibility cookies

You can manually enable or disable cookies on certain websites by updating your site preferences on your web browser.

Third-party cookies

You've probably heard of the most controversial type of cookie in terms of data privacy. Third-party cookies usually track your behavior for advertising purposes, and they can even follow users across websites. 

Unlike first-party cookies, third-party cookies often aren't even due to the website you're visiting. Instead, they’re usually embedded in ads, videos, or banners. A good example of a third-party cookie is seeing recurring clothing ads after browsing. Even clicking the Facebook "like" button uses third-party cookies. That's why we recommend using an ad blocker that stops cookies and trackers.

Examples of third-party cookies

  • Behavioral advertising cookies
  • Cross-site tracking cookies
  • Social media integration cookies
  • Affiliate marketing cookies
  • Customer profiling cookies
  • Retargeting cookies
  • Third-party analytics cookies
  • Content personalization cookies
  • Ad exchange cookies

Tracking cookies are an invasion of privacy. You can stop cookie profiling by using a secure web browser, enabling an ad blocker, installing a virtual private network, or disabling browser cookies.

Session cookies

Session cookies (also known as transient cookies or non-persistent cookies) are temporary cookie files that are erased when you close your browser. They don't store information that could identify you personally and are used to improve your experience on a particular website. Session cookies enable you to add an item to your shopping cart, browse multiple other pages, and then still keep track of your item in your cart. They are one of the most common types of cookies.

When you restart your browser and go back to the site that created the session cookie, the website will not recognize you, and you'll have to log back in (if login is required) or select your preferences/themes again if the site uses these features. If you do revisit that same website, a new session cookie will be generated, which will store your browsing information and will be active until you leave the site and close your browser.

Like first-party cookies, session cookies are considered necessary for a website to function as intended. Necessary cookies may not require explicit consent based on legislation that requires websites to disclose their cookies and prompt users to "opt-in."

Persistent cookies

Persistent cookies are not deleted when you close your browser. These cookies track you, collecting your information at every website. These cookies let websites remember if you're logged in and under which account. Persistent cookies also build a profile based on your search history to recommend products, services, or content.

Persistent cookies stay in one of your browser's subfolders until you delete them manually or your browser deletes them based on the duration period contained within the persistent cookie's file. Persistent cookies typically have expiration dates.

However, if persistent cookies are used for tracking or advertising, you must consent to let the website collect your data.

Websites must comply with data privacy laws like the General Data Protection Regulation (GDPR) and the California Consumer Privacy Act (CCPA).

Bottom line

While some cookies are downright helpful at optimizing your browsing experience, others are annoying or even harmful. A convenient way to help manage your cookies is by using a top ad blocker that helps stop tracking cookies.

We've tested nearly 20 popular ad blockers and think Total Adblock and Surfshark CleanWeb are some of the best. 

Ad blocker
CleanWeb
Best for Best overall Best all-in-one bundle
Price Free or $1.59/mo $2.19-$20.65/mo
Blocks YouTube ads
Adblock Tester score 100/100 98/100
Learn more Get Total Adblock Get Surfshark CleanWeb

#1 Adblocker — Even Blocks YouTube Video Ads
4.9
Editorial Rating
Learn More
On Total Adblock's website
Ad Blocker
Total Adblock
Up to 80% off
  • Instantly blocks distracting ads on millions of websites, including Facebook and YouTube ads
  • Blocks third-party trackers to protect your privacy and information
  • Improves page load times and enables faster browsing