What is a cookie and how
does it work?

A complete guide to internet cookies

A cookie is a small piece of data stored on your device by your web browser when you visit a website. Cookies help websites remember your preferences, keep you logged in, and provide a more personalized browsing experience.

Why do websites use cookies? Key reasons and use cases

Remembering your login

Session cookies keep you signed in as you move between pages so you don’t have to re-enter your credentials every click.

Keeping items in your cart

Shopping carts rely on cookies to remember what you’ve added so your items persist while you browse and when you return.

Saving preferences

Cookies store things like language, theme, and accessibility settings to personalize the site to your choices.

Analytics & performance

First-party analytics cookies help measure traffic and errors so teams can improve speed, reliability, and UX.

Personalized content

Preference cookies can tailor recommendations or show recently viewed items that are more relevant to you.

Advertising choices & consent

Consent and ad-preference cookies remember opt-in/opt-out selections and help limit repetitive or irrelevant ads.

What Are Internet Cookies?

Cookies (often known as internet cookies) are text files with small pieces of data — like a username and password — that are used to identify your computer as you use a network. Specific cookies are used to identify specific users and improve their web browsing experience. Data stored in a cookie is created by the server upon your connection. This data is labeled with an ID unique to you and your computer. When the cookie is exchanged between your computer and the network server, the server reads the ID and knows what information to specifically serve you. Due to international laws, such as the EU’s General Data Protection Regulation (GDPR), and certain state laws, like the California Consumer Privacy Act (CCPA), many websites are now required to ask for permission to use certain cookies with your browser and provide you with information on how their cookies will be used if you accept.

Schedule
Magic cookiesMagic cookies are an old computing term that refers to packets of information that are sent and received without changes to the data. This would commonly be used for a login to computer database systems, such as a business internal network. This concept predates the modern “cookie” we use today.
Schedule
HTTP cookiesHTTP cookies are a repurposed version of the “magic cookie” built for contemporary internet browsing. In 1994, web browser programmer Lou Montulli used the “magic cookie” as inspiration to create the HTTP cookie, whilst he was helping an online shopping store fix their overloaded servers. The HTTP cookie is what we currently refer to as a cookie more generally today. It is also what some cybercriminals can use to spy on your online activity and hack your personal information.
Cookie

What are tracking cookies?

Tracking cookies are small text files that websites place on a user’s browser to collect data about their online activities. These files contain data that allows websites to remember specific user preferences, maintain login sessions, and track user behavior across different sites. They store information such as geographic location, device specifications, and specific actions taken on the website. The primary purpose of tracking cookies is to enable personalized experiences, targeted advertising, and for website analytics. Tracking cookies can be categorized into two types: first-party and third-party cookies. First-party cookies are set by the website the user is currently visiting, while third-party cookies are created by external services or advertisers.

ScheduleTracking cookies work by assigning a unique identifier to each user. This identifier is stored within the cookie and enables websites to recognize and differentiate individual users.
ScheduleWhen a user visits a website, it may set both first-party cookies and third-party cookies on the user’s browser. First-party cookies store user-specific information such as login details, language settings, and preferences, which they remember on subsequent user visits to the same site. Third-party cookies gather broader data about the user’s activities across various websites.
ScheduleBoth types of cookies store and retrieve data, but they differ in their scope and application — first-party cookies focusing on improving user experience on the website visited, and third-party cookies being instrumental in broader online behavior tracking for advertising purposes.
Cookie

How browser tracking cookies are used

Tracking cookies are widely used by businesses for various purposes. Here are a few online tracking examples:

Schedule
Ecommerce personalizationWhen a user visits an ecommerce website, tracking cookies can remember their browsing history and purchase preferences. This allows the website to recommend relevant products, offer personalized discounts, and streamline the purchasing process.
Schedule
Ad targetingAdvertisers use tracking cookies to deliver targeted advertisements based on a user’s interests and browsing behavior. For example, if a user frequently visits travel websites, they may be shown ads for vacation packages or flight deals.
Schedule
Analytics and optimizationTracking cookies provide valuable data for website owners to identify trends and optimize their site’s performance. For example, a retail website might use tracking cookies to see which products are most frequently viewed and purchased. This data helps the business understand how users interact with their website, such as which pages are most popular or which products are often added to the cart but not purchased.
Schedule
Social media integrationMany websites incorporate social media plugins that use tracking cookies to enable users to share content or log in using their social media accounts. These cookies allow websites to personalize the user’s website experience based on their social media preferences and activities.
Cookie

What are HTTP Cookies?

HTTP cookies, or internet cookies, are built specifically for web browsers to track, personalize and save information about each user’s session. A “session” is the word used to define the amount of time you spend on a site. Cookies are created to identify you when you visit a new website. The web server — which stores the website’s data — sends a short stream of identifying information to your web browser in the form of cookies. This identifying data (known sometimes as “browser cookies”) is processed and read by “name-value” pairs. These pairs tell the cookies where to be sent and what data to recall. So, where are the cookies are stored? It’s simple: your web browser will store them locally to remember the “name-value pair” that identifies you. When you return to the website in the future, your web browser returns that cookie data to the website’s server, triggering the recall of your data from your previous sessions.

Schedule
You hand over your “coat” to the cloak desk.You connect/visit a website and a pocket of data is linked to you on the website’s server. This data can be your personal account, your shopping cart or even just what pages you’ve visited.
Schedule
You get a “ticket” to identify you as the “coat” owner.The cookie (containing the data) is then given to you and stored in your web browser. It has a unique ID especially for you.
Schedule
If you leave and return, you can get the “coat” with your “ticket”.When you revisit the website, your browser gives the website the cookie back. The website then reads the unique ID in the cookie to assemble your activity data, bringing you back to where you were when you first visited, as if you never left.
Cookie

What are the different types of HTTP Cookies?

With a few variations (which we’ll discuss later), cookies in the cyber world essentially come in two types: session cookies and persistent cookies.

Session cookies are used only while navigating a website. They are stored in random access memory and are never written onto the hard drive. When the session ends, session cookies are automatically deleted. They also help the "back" button work on your browser.

Persistent cookies, on the other hand, remain on a computer indefinitely, although many include an expiration date and are automatically removed when that date is reached. Persistent cookies are used for two primary purposes:

  1. Authentication. These cookies track whether a user is logged in and under what name. They also streamline login information, so users don’t have to remember site passwords.
  2. Tracking. These cookies track multiple visits to the same site over time. Some online merchants, for example, use cookies to track visits from particular users, including the pages and products viewed. The information they gain allows them to suggest other items that might interest visitors. Gradually, a profile is built based on a user’s browsing history on that site.

Keep Your Device Safe from Harmful Cookies

Clean harmful cookies and trackers with Premium Cleaning to safeguard your privacy and device.

Try Premium for Free

First-Party vs. Third-Party Cookies

From here, internet cookies can be broken down into two further categories: first-party and third-party. Depending on where they come from, some cookies may potentially be more of a threat than others.

First-party cookies are directly created by the website you are using. These are generally safer, as long as you are browsing reputable websites or ones that have not been compromised by a recent data breach or cyberattack.

Third-party cookies are more troubling. They are generated by websites that are different from the pages that the users are currently surfing, usually because they’re linked to ads on that page. Third-party cookies let advertisers or analytics companies track an individual’s browsing history across the web on any sites that contain their ads. However, as previously mentioned, due to new data protection laws, allowing third-party cookies to access your browser is now optional in many countries and states. These days, most third-party cookies have no direct impact on your browsing experience, as many browsers have already begun phasing them out. Many websites still operate fine and remember your preferences without using third-party cookies.

Zombie cookies are a form of third-party, persistent cookie, which are permanently installed on users’ computers. They have the unique ability to reappear after they’ve been “deleted” from your computer. They are also sometimes called “flash cookies” or “supercookies” and are extremely difficult to remove. Like other third-party cookies, zombie cookies can be used by web analytics companies to track unique individuals’ browsing histories. Websites may also use zombies to ban specific users. In some cases, however, these types of cookies can be fabricated by hackers and used to infect your system with viruses and malware.

Essential Cookies are now synonymous with the pop-up asking you for your cookie preferences when you first visit a website. Essential cookies are first-party session cookies that are necessary to run the website or services you have requested online (such as remembering your login credentials).

Need Help ?