Cookies Explained: What They Are, How They Work and How to Manage Them

computer cookies

Cookies are small files that websites save on your device so they can remember you, and you can switch them on, switch them off or clear them in a couple of minutes in any browser.

This guide explains what cookies are, how they work, and what “accept all” really means. It then gives step-by-step instructions for Chrome, Firefox and Safari on a computer, plus iPhone, iPad and Android. Menu names change slightly between browser versions, so if a label looks a little different on your screen, look for the closest match.

What are cookies and what do cookies do?

A cookie is a small text file that a website stores in your browser so it can recognise you the next time you visit. It usually holds a name, a short value (often just a random ID), the website it belongs to and an expiry date.

Cookies are plain data. They can’t run programs or carry viruses on their own. What they do is give the web a memory, because without them every page you opened would treat you as a stranger. Cookies are what allow a website to:

  • keep you logged in as you move between pages
  • remember what’s in your shopping cart
  • save preferences such as language, region or dark mode
  • count visitors and see which pages are popular
  • show ads based on what you’ve looked at elsewhere

How internet cookies work

Cookies work through a short exchange between your browser and a website’s server, and it happens in the background every time you load a page.

  1. You open a page, and your browser asks the website’s server for it.
  2. The server sends the page back along with an instruction to store a cookie, such as a random session ID.
  3. Your browser saves the cookie against that website’s address, along with an expiry time.
  4. On every later request to the same site, your browser automatically sends the cookie back.
  5. The server reads the cookie, recognises you and responds to suit, for example by keeping you logged in or showing the items in your cart.

In most cases the cookie holds only a random ID. Your actual details stay on the website’s own servers. Browsers also only send a cookie back to the site that set it, which is why cookies set by embedded content (covered below) draw so much attention.

A cookie ends in one of two ways. A session cookie disappears when you close the browser, while a persistent cookie stays until its expiry date or until you delete it.

Types of cookies

Cookies are usually grouped by how long they last and what they are for.

Type What it does How long it lasts Example
Session Remembers you while you move around a site Until you close the browser Staying logged in during one visit
Persistent Remembers you between visits Until its expiry date, from days to years “Remember me” on a login screen
Essential Makes basic features work Usually the session Shopping cart, security checks
Analytics Counts visits and shows which pages are used Weeks to years Measuring website traffic
Advertising and tracking Builds a profile of your interests Often months to years Showing ads for products you viewed

What are third-party cookies?

A first-party cookie is set by the website you are visiting. A third-party cookie is set by a different domain, usually something embedded in the page such as an ad, a social media button or a video player.

Here is why that matters. If two unrelated websites both use the same advertising network, that network’s cookie can recognise you on both. Over time it builds a picture of what you read and shop for, which is the main privacy concern with third-party cookies.

Where the main browsers stand as of October 2026:

  • Safari and Firefox restrict third-party cookies by default. Firefox also deletes tracking cookies from sites you haven’t interacted with recently.
  • Chrome still lets you choose. Google dropped its plan to phase out third-party cookies, so they remain available unless you block them. Incognito windows block them by default.

First-party cookies are a different matter. They are what keep you logged in and your cart full, so blocking them tends to break websites far more than blocking third-party cookies does.

What does accepting cookies mean?

When you click “Accept” on a cookie banner, you are giving a website permission to store optional cookies on your device, and often to share the data they collect with its analytics and advertising partners. You are not giving it access to your files, passwords or camera.

Most banners offer three choices:

  • Accept all allows every type, including analytics and advertising cookies.
  • Reject all or Necessary only allows just the cookies the site needs to function.
  • Manage preferences lets you switch categories on or off one by one.

If you accept, the site can remember your settings and show more personalised content and ads. If you reject, the site will normally still work, but ads are likely to be less relevant to you and some preferences may not be remembered.

Your banner choice is itself stored in a cookie. If you clear your cookies, the banner will appear again and you can choose differently.

Are cookies safe?

Cookies themselves are safe, because they are plain text and not programs, so they can’t infect your device. The real concerns are privacy and shared devices.

  • Tracking: advertising cookies can follow you across websites and build a profile of your interests.
  • Stolen sign-ins: if someone gets hold of a login cookie, for example through malware or an unsecured connection, they may be able to take over your session. Stick to secure (https) sites and keep your browser up to date.
  • Shared computers: the next person using a library or work computer could still be signed in to your accounts. Always log out and clear cookies when you finish.

In New Zealand, the Privacy Act 2020 has no cookie-specific rule, but it applies to any personal information a website collects about you. The Office of the Privacy Commissioner explains your rights.

How to enable cookies in your browser

Cookies are on by default in every major browser, so you only need these steps if you or someone else switched them off, or if a website says cookies are disabled. After changing a setting, reload the page. If the options are greyed out, the device may be managed by a work or school and the setting locked.

Google Chrome (Windows, Mac and Chromebook)

Chrome has one setting for the cookies a site sets for itself and another for third-party cookies.

  1. Click the three dots at the top right, then Settings.
  2. Go to Privacy and security, then Site settings.
  3. Scroll down, open Additional content settings, then click On-device site data.
  4. Choose Allow sites to save data on your device.
  5. If a site still fails, go back to Privacy and security, click Third-party cookies and choose Allow third-party cookies. You can also add just that one site under “Sites allowed to use third-party cookies”.

Mozilla Firefox

  1. Click the menu button (three lines) at the top right, then Settings.
  2. Select Privacy & Security.
  3. Under Enhanced Tracking Protection, choose Standard. If you chose Custom earlier, make sure the Cookies box is not ticked.
  4. Scroll to Cookies and Site Data and make sure “Delete cookies and site data when Firefox is closed” is not ticked.
  5. If one site is still blocked, click Manage Exceptions in the same section and remove it from the list.

Safari on Mac

  1. Open Safari, click Safari in the menu bar, then Settings.
  2. Click Advanced (on older versions of macOS, click the Privacy tab instead).
  3. Make sure Block all cookies is not ticked.

Safari also has a Prevent cross-site tracking option. Leave it on unless a particular site, such as a work or school portal, won’t work without it turned off.

Safari on iPhone and iPad

  1. Open Settings, tap Apps, then tap Safari.
  2. Scroll to the bottom and tap Advanced.
  3. Turn Block All Cookies off.

On iOS 17 and earlier, the switch sits directly under Settings > Safari, in the Privacy & Security section.

How to disable cookies in your browser

Blocking only third-party cookies is the safest middle ground, because it cuts down tracking without stopping most sites from working. Blocking every cookie will break logins, shopping carts and saved settings on many websites. Blocking also doesn’t remove cookies that are already stored, so clear those as well (see the next section).

Google Chrome (Windows, Mac and Chromebook)

  1. Click the three dots at the top right, then Settings.
  2. Go to Privacy and security, then Third-party cookies.
  3. Choose Block third-party cookies. The other options are to allow them, or to block them only in Incognito mode.
  4. To make an exception, click Add beside “Sites allowed to use third-party cookies” and enter the site.

To stop websites saving any data on your device, go to Privacy and security > Site settings > Additional content settings > On-device site data and choose Don’t allow sites to save data on your device. Chrome marks this as not recommended, because many sites won’t work. A gentler option is Delete data sites have saved to your device when you close all windows.

Mozilla Firefox

  1. Click the menu button (three lines) at the top right, then Settings.
  2. Select Privacy & Security.
  3. Under Enhanced Tracking Protection, choose Custom and tick Cookies.
  4. Use the drop-down menu to pick which cookies to block. The choices run from cross-site tracking cookies only, up to all cookies, which Firefox warns will stop some websites working.
  5. To block one site only, click Manage Exceptions under Cookies and Site Data, type the site’s address and click Block, then Save Changes.

Safari on Mac

  1. Open Safari, click Safari in the menu bar, then Settings.
  2. Click Advanced (on older versions of macOS, click the Privacy tab instead).
  3. Tick Block all cookies.

To block only cross-site tracking, go to the Privacy tab and tick Prevent cross-site tracking instead. This is on by default, and it doesn’t break as many sites.

Safari on iPhone and iPad

  1. Open Settings, tap Apps, then tap Safari.
  2. Scroll to the bottom and tap Advanced.
  3. Turn on Block All Cookies. Apple warns that some webpages might not work as a result.

On iOS 17 and earlier, the switch sits directly under Settings > Safari, in the Privacy & Security section.

How to clear cookies on a computer, iPhone, iPad and Android

Clearing cookies deletes what websites have stored on your device. You will be signed out of most sites, and cookie banners will ask for your choice again. It is worth doing when a site misbehaves, after you change your cookie settings, or when you finish on a shared device.

On a computer

Chrome: press Ctrl+Shift+Delete (Cmd+Shift+Delete on a Mac), or go to Settings > Privacy and security > Delete browsing data. Choose a time range, tick Cookies and other site data, untick the other items, then click Delete data.

Firefox: open Settings > Privacy & Security, find the Cookies and Site Data section and click Clear Data. Tick Cookies and Site Data, then click Clear. To remove one site only, click Manage Data instead and remove it from the list.

Safari on Mac: open Safari > Settings > Privacy, click Manage Website Data, select one or more sites and click Remove, or choose Remove All.

On an iPhone or iPad (Safari)

On iOS 17 and earlier, the same options are under Settings > Safari rather than Settings > Apps > Safari.

  • Clear everything, including history: go to Settings > Apps > Safari, tap Clear History and Website Data, then confirm.
  • Clear cookies but keep your history: go to Settings > Apps > Safari > Advanced > Website Data, then tap Remove All Website Data.
  • Clear one site only: in the same Website Data screen, search for the site, swipe left on it and tap Delete.

Chrome and Firefox on an iPhone or iPad keep their own data, so clearing Safari does not clear them. Use the delete browsing data option in each of those apps.

On an Android phone or tablet

Chrome:

  1. Open Chrome, tap the three dots at the top right, then tap Settings.
  2. Tap Privacy and security, then Delete browsing data.
  3. Choose a time range, such as All time.
  4. Tick Cookies and site data and untick anything you want to keep.
  5. Tap Delete data. If you are signed in to Chrome, you stay signed in to your Google Account.

Firefox: tap the menu button, then Settings > Delete browsing data. Tick Cookies, then tap Delete browsing data.

Samsung Internet: tap the menu button (three lines), then Settings > Personal data > Delete browsing data. Choose Cookies and site data, then tap Delete.

Menu names vary a little between Android versions and phone brands. If you can’t find an option, look for the nearest match under the browser’s privacy settings.

How to get rid of tracking cookies

Tracking cookies are the advertising and cross-site cookies described earlier. Getting rid of them takes three steps: delete the ones you already have, stop new ones arriving, and cut down what you agree to.

  1. Delete existing cookies. Follow the clearing steps above and choose All time so older tracking cookies go too.
  2. Turn on your browser’s tracking protection.
    • Chrome: choose Block third-party cookies under Settings > Privacy and security > Third-party cookies.
    • Firefox: choose Standard or Strict under Enhanced Tracking Protection. Strict blocks more but is more likely to break some sites.
    • Safari: keep Prevent cross-site tracking switched on. It is on by default, in the Privacy tab on a Mac and in Settings > Apps > Safari on iPhone and iPad.
  3. Say no on cookie banners. Choose Reject all or Necessary only, or use Manage preferences to switch off advertising and analytics cookies.
  4. Add a tracker blocker. Extensions such as Privacy Badger or uBlock Origin block many trackers before they load. Check that the extension is available for your browser and install it only from the browser’s official store.
  5. Use a private window for sensitive browsing. Private or Incognito windows throw away their cookies when you close them, and Chrome’s Incognito mode also blocks third-party cookies by default.

Two things to keep in mind. First, clearing cookies does not stop every kind of tracking, since some sites also identify you by your browser and device characteristics. Second, if your antivirus program reports “tracking cookies”, these are usually ordinary advertising cookies and not a virus, and deleting them is enough.

Do I have to accept cookies? No. Essential cookies are needed for a site to work, but you can reject the optional ones, and most sites will still load.

Will clearing cookies delete my saved passwords? Not by default. Saved passwords are a separate item in your browser’s delete dialog, so leave that box unticked if you want to keep them.

Are cookies the same as the cache? No. Cookies remember who you are and what you chose. The cache stores copies of images and files so pages load faster.

A site says cookies are disabled, but I’ve turned them on. What now? Reload the page, then check for a site-specific block, a privacy extension, or a setting that deletes data when the browser closes. Clearing cookies for that site or trying a different browser will usually show which one it is.

Need a hand with your browser or privacy settings?

For most people, the best balance is to leave cookies on, block third-party cookies, reject optional cookies on banners, and clear your cookies now and then. If a setting won’t change, a site still won’t load, or you suspect something more than ordinary tracking cookies is on your computer, the team at Advanced Computers can help you sort it out.

Posted in blog.