On this page 12 sections

Website cookies are small pieces of data that a website asks your browser to save, so the site can recognise you on your next click or visit. They are not biscuits, sadly, but they are the reason an online shop remembers what is in your cart.
This guide explains what website cookies are, how they work, where they are stored and their pros and cons, with a section on what South African business owners need to do about them.
Short answer
- What they are: a small piece of data, a name and a value, that a website sends to your browser. The browser saves it and sends it back with later requests to that site.
- Where they are stored: in your browser, on your own device.
- The good: they keep you signed in, hold your cart and remember your settings.
- The bad: third-party cookies can follow you from site to site, and badly set up cookies can be stolen.
- If you run a website: POPIA applies. Tell visitors which cookies you use, and ask for consent before marketing and tracking ones.
How do cookies work?
A website forgets you between requests unless cookies give it a memory. The usual sign-in example works like this:
- You sign in with your username and password.
- If they are correct, the website's server replies with a cookie holding a session ID, a code that stands for your sign-in.
- Your browser saves the cookie.
- Each time you open another page on that site, the browser sends the cookie back, so the server knows you are still signed in. The cookie usually holds a code, not your details. The server looks the code up to find the rest.
Why are they called cookies?
No chocolate chips, we are afraid. In 1994 an engineer at Netscape, Lou Montulli, built the first web cookies. He borrowed the name from "magic cookie", programmers' slang at the time for a small piece of extra information passed between programs. As for the taste test: the real thing wins every time, but it cannot remember your shopping cart.
Where are cookies stored?
In your browser, on the device you are using. The server sends a cookie, the browser keeps it, and the server only sees it when the browser sends it back. Whatever the server remembers about you, such as your cart, usually sits in its own database and is found using the ID in the cookie.
Browsers limit cookies. The internet standard (RFC 6265) says browsers should support at least 4,096 bytes per cookie, 50 cookies per domain and 3,000 in total. Cookies are sent with every request, so big or many cookies can slow a page down on a slow mobile connection.
Types of cookies
Cookies are described by who sets them, how long they last and what they are for.
- First-party cookies are created by the site you are visiting. Third-party cookies are created by other sites whose content is embedded in the page, such as ads, images or social buttons.
- Session cookies have no expiry date, so the browser removes them when the session ends. Persistent cookies stay until their expiry date or maximum age.
Purpose What it does Example Session management Keeps you signed in and holds your cart A shop remembering your basket Personalisation Remembers settings such as language or theme A site staying in Afrikaans Analytics Counts visitors and shows how a site is used The Google Analytics _gacookie, which lasts 2 years by defaultTracking and advertising Records what you browse to show you ads Ad cookies set by third parties
Pros and cons of cookies
The pros
- You stay signed in instead of logging in on every page.
- Shopping carts work as you move between pages.
- Sites remember your language and other settings.
- Owners can see which pages people use and fix what is not working.
- A cookie is the recommended place for a session ID, because the HttpOnly setting stops page scripts reading it, even in a cross-site scripting attack.
The cons
- Tracking: third-party cookies can build a profile of what you browse across many sites.
- Theft: if someone steals a session cookie, they may be able to act as you. The Secure, HttpOnly and SameSite settings reduce that risk.
- Broken features: blocking third-party cookies can break embedded content such as social media widgets.
- Legal duties: for a business, cookies bring POPIA obligations (see below).
Are cookies safe?
A cookie is a small piece of data, not a program. The real risks are tracking by third parties and the theft of a session cookie from a badly set up site.
As a visitor, reject non-essential cookies and turn on two-step sign-in where it is offered. Our guide to what MFA is and how to switch it on explains how. As a business, ask your developer to confirm that login cookies use the Secure, HttpOnly and SameSite settings, and read what to do if your website is hacked if you suspect a problem.
What browsers do about third-party cookies
Browsers treat third-party cookies differently, so don't build anything important on them.
- Safari blocks all third-party cookies by default. The only way around it is its Storage Access API.
- Firefox turns on Total Cookie Protection by default in Standard mode, which keeps each site's cookies in a separate "cookie jar".
- Chrome planned to phase them out, but Google said in April 2025 that it would keep its current approach and add no new prompt. People can block them in settings, and Incognito blocks them by default. In October 2025 Google retired several Privacy Sandbox ad technologies, including Topics. The practical lesson: use first-party cookies for sign-in, carts and analytics.
How to control cookies as a visitor
- Chrome on a computer: select More, then Delete browsing data, choose a time range and tick Cookies and other site data. You may be signed out of sites that remember you. To see or block cookies, go to Settings > Privacy and security > Third-party cookies.
- Safari on a Mac: choose Safari > Settings > Privacy, then turn on "Prevent cross-site tracking" or choose "Block all cookies". Blocking all can stop some sites working.
What South African website owners need to know
This is general information, not legal advice.
- POPIA applies to cookies. POPIA does not mention cookies by name, but it defines personal information to include an "online identifier", and the law firm Michalsons says POPIA applies to cookies.
- Tell visitors. Section 18 says you must take reasonable steps to make people aware of what you collect, why, who you are and what their rights are. Michalsons says this likely means a cookie notice and a separate cookie policy.
- Ask for consent where needed. Michalsons reads section 69 as requiring consent for cookies used for direct marketing to people who are not your customers, while strictly necessary cookies need no explicit consent. In its last update (November 2022) it noted that the Information Regulator had not indicated specific cookie rules.
- Analytics too. Google says that if you use Google Analytics, you must tell users what is stored and let them grant or deny consent.
- Visitors from abroad. The EU's GDPR and ePrivacy rules have global reach for sites that people in those regions use, so check which rules apply.
Cookie checklist for your website
| Question | What to do |
|---|---|
| Which cookies does our site set? | Ask your developer for a list, including cookies from embedded maps, chat, video and social buttons. |
| Do any need consent? | Ask first for marketing, advertising and tracking cookies, and check your analytics set-up. |
| Do visitors know? | Add a cookie notice, a cookie policy and a "Cookie preferences" link in the footer. |
| Are login cookies secure? | Check for the Secure, HttpOnly and SameSite settings, and HTTPS across the whole site. |
| Do we depend on third-party cookies? | Move sign-in, carts and analytics to first-party cookies where you can. |
| When did we last review? | Review whenever you add a tool or change what cookies are used for. |
Need help with cookies on your website?
We build and maintain websites for small and medium businesses. If you want your site's cookies reviewed, or a new site built with them handled properly, talk to our web development team, or contact us and tell us what you need. To measure results without guessing, see our SEO and digital marketing work.
Facts checked on 1 December 2026. Sources: MDN: Using HTTP cookies (opens in a new window), RFC 6265 (opens in a new window), Chrome Help (opens in a new window), Google Privacy Sandbox (opens in a new window), WebKit (opens in a new window), Mozilla (opens in a new window), POPIA section 18 (opens in a new window), Michalsons (opens in a new window). Google, Chrome and Google Analytics are trademarks of Google LLC. Safari is a trademark of Apple Inc. Firefox is a trademark of the Mozilla Foundation.