Cookies are small text files that websites store in a user’s browser when a page loads. They are created by the web server and saved locally on the device so the site can recognize the browser during the current visit or on future visits. Each time the page is opened, the browser automatically sends the cookie back to the server.
These files are commonly used to remember login sessions, language settings, and other preferences, but they can also store identifiers linked to analytics and advertising systems. Cookies may come from the website being visited or from external domains that provide ads, tracking tools, or embedded content.
Because cookies can be set without direct interaction, they often load alongside scripts and advertising requests in the background, which is why some users run an Ad-Blocker to limit how tracking data and related resources are stored during normal browsing.
TLDR
Cookies are small data files stored in the browser that websites use to remember sessions, save settings, and track activity by sending information back to the server each time a page loads.
How Cookies Work
When a user visits a website, the server sends a small piece of data called a cookie to the browser along with the page content.
The browser stores this file locally and automatically includes it in future requests to the same site, allowing the server to recognize the session without asking for the same information again. This is how websites remember logins, saved preferences, and other settings between visits.
Cookies can also contain identifiers that advertising platforms and analytics tools use to understand how a page is being used.
When a site loads ads or external content, ad servers or tracking services may create additional cookies to measure activity, apply targeting rules, or connect visits across multiple pages. These actions happen automatically as part of the normal page-loading process.
Because many sites now request permission before storing tracking data, some users use tools such as a cookie banner blocker to stop consent scripts from running before cookies are written to the browser.
Types of Cookies
Cookies are grouped into several categories based on who creates them and how long they remain stored in the browser. The most common types include:
- First-party cookies: set by the website the user is visiting and are mainly used for session data, preferences, and basic site functions.
- Third-party cookies: created by external domains, often through ads, analytics tools, or embedded content loaded from other servers.
- Session cookies: temporary files that are removed when the browser is closed and used to keep a session active while a page is open.
- Persistent cookies: stored for a defined period, allowing the site to recognize the browser on future visits.
- Advertising or tracking cookies: used by ad networks to store identifiers that support targeting and performance measurement.
- Necessary cookies: required for core site features such as logins, security checks, or page navigation.
These categories exist because websites, advertisers, and external services each rely on different cookie types to manage sessions, deliver content, and track activity.
Why Cookies Are Used in Online Advertising
Cookies play a key role in online advertising because they allow ad networks to recognize browsers and store identifiers that can be reused across different websites.
When a page loads ads from external servers, third-party cookies may be created to record visits, assign user IDs, and connect activity across multiple domains. This makes it possible to show targeted ads, limit how often the same ad appears, and measure whether an ad was viewed or clicked.
Because advertising platforms can read cookies, they are part of the wider ad-tech stack used for personalization, analytics, and programmatic ad delivery, but also enable cross-site tracking, which some users choose to restrict.
How Users Limit Cookies
Modern browsers provide several ways to control how cookies are stored and used. Users can delete existing cookies, block new ones from being saved, or restrict third-party cookies so external domains cannot track activity across different websites.
These settings reduce how often identifiers are reused, but many pages now load consent banners and scripts before the browser rules are fully applied.
Because cookie requests are often triggered by advertising or analytics code, some users rely on filtering tools that stop those requests before they complete. In some cases, extensions such as an ad blocker for Chrome are used to block external scripts during page load, preventing certain cookies from being written to the browser.