Cookies. As a cloud cybersecurity expert with over a decade of experience, I‘ve spent many hours analyzing these small text files that follow you around the web. I‘m fascinated by all aspects of emerging web technologies, especially in terms of privacy and security.
In this complete cookie guide, we‘ll dive deep into everything you need to know about cookies:
- What exactly are cookies and how do they work their magic?
- Where are cookies located on your devices?
- How to view and delete cookie files to take control of your privacy
- Best practices for managing cookies securely
I‘ll also provide my expert perspective on cookie privacy concerns and how to balance usability with enhanced security. Let‘s get right into it!
Contents
- Demystifying Cookies: A Cloud Security Expert‘s Guide to How Cookies Work
- A Technical Breakdown of Where Cookies Are Stored
- How to View and Delete Browser Cookies (Step-by-Step)
- Smart Cookies: A Cybersecurity Expert‘s Cookie Management Best Practices
- The Bottom Line: Cookies Can Be Good With Proper Privacy Precautions
Demystifying Cookies: A Cloud Security Expert‘s Guide to How Cookies Work
Cookies might seem complicated, but think of them like a loyalty punch card at your favorite cafe. Every time you visit, they punch your card. This lets them identify you as a regular customer and remember your favorite drink order.
Similarly, every time you visit a website, it can send a cookie to your web browser identifying you as a returning visitor. This allows the site to "remember" important details that make your experience smoother.
For example, cookies remember:
- Products in your shopping cart so they‘re still there when you return
- Login credentials so you stay logged into sites automatically
- Website preferences like default language
- Personalization settings like a saved username or profile information
My first encounter with cookies was in the 90‘s when internet shopping was just taking off. I bought a computer book online, and was amazed that after closing my browser, the item was still in my cart upon returning! This "magic" was thanks to cookies.
The Technical Side: How a Cookie Works
Cookies are comprised of a simple text file, like this:
name=John
cart=[book1, book2]
id=123456789
When you first visit a website, it sends an HTTP request to your browser asking to set a cookie. If you allow it, your browser will store the cookie file in a designated folder on your hard drive or mobile device.
The next time you visit, your browser automatically sends that cookie data back to the site. The website checks your cookie to recall details like "John‘s shopping cart has book1 and book2".
Browser cookies were limited to just 4KB of storage in the early days. Modern browsers now allow at least 8KB per cookie, with dozens or hundreds of cookies permitted per site.
From a technical perspective, here‘s a more detailed play-by-play of what happens behind the scenes when a site sets a cookie:
-
You visit example.com for the first time.
-
Example.com sends an HTTP response containing a Set-Cookie header that might look like:
Set-Cookie: name=John; Expires=Wed, 21 Oct 2025 07:28:00 GMT
-
Your browser sees this request and stores the cookie name=John in its cookie folder. It also notes the expiration date.
-
On your next visit, your browser automatically sends the cookie back to example.com in the HTTP request:
Cookie: name=John
-
The website checks the cookie data and knows to greet you by name!
Cookies are a handy tool that websites rely on to deliver personalized, seamless experiences. However from a privacy standpoint, we have to be careful about the types of data cookies store and who has access to that data.
Session vs. Persistent Cookies: Temporary vs. Stored Long-term
Based on lifespan, there are two main cookie categories:
Session cookies only last until you close your browser window. They enhance your current site visit, helping track you from page to page to keep items in your shopping cart or remember you‘re logged in. Once the browser closes, session cookies are deleted.
Persistent cookies have an expiration timeframe set by the website via that Expires attribute, which can range from a few minutes to over a year! These stay saved on your device and get sent back to the site on future visits. Persistent cookies remember details like username, language preference, profile information etc across multiple sessions.
As a cybersecurity expert, I tend to favor session cookies over persistent ones from a privacy standpoint. However, persistent cookies do offer convenient functionality. As with most technologies, it comes down to balancing usability and privacy.
First-party vs. Third-party Cookies: Site You Visited vs. Someone Else
Cookies are also classified based on which website sets them:
First-party cookies are from the site you directly interact with. For example, if you go to example.com, any cookies set by example.com are first-party. These usually enhance site functionality.
Third-party cookies come from domains other than the one you are visiting. For instance, example.com may allow advertising partners like ads.com to set cookies on their site. Those are third-party cookies since you didn‘t visit the ads.com site directly.
Here‘s a real life example:
- You visit huffingtonpost.com which displays ads from adtech.com
- adtech.com sets a cookie to track you across sites for targeting
- Later, you visit techcrunch.com which also shows adtech.com ads
- adtech.com reads its cookie and knows to serve you targeted ads based on your earlier browsing
Third-party cookies like these are concerning from a privacy perspective, since they can follow you around the web for profiling. As a security expert, I recommend blocking third-party cookies when possible.
Now that you understand the basics of how cookies work, let‘s explore where they are physically stored on your devices.
A Technical Breakdown of Where Cookies Are Stored
Websites may use cookies to store data about you, but where is that cookie data physically located on your devices?
Cookies are stored in specific folders determined by your operating system and browser. Being aware of their exact locations is helpful for managing privacy and security.
Cookie Storage Locations on Windows PCs
On Windows, cookies are sorted into individual browser-specific folders. The default location is inside your user profile‘s AppData folder.
For example, John Smith‘s Windows cookies would be in:
C:\Users\JohnSmith\AppData\Local
(or Roaming for some browsers)
The AppData folder in Windows is hidden by default. To view it, you need to enable "Show hidden files and folders" in Windows Explorer. Here are the specific locations for each browser:
Google Chrome stores cookies here:
C:\Users\[Your Name]\AppData\Local\Google\Chrome\User Data\Default\Cookies
Mozilla Firefox stores them here:
C:\Users\[Your Name]\AppData\Roaming\Mozilla\Firefox\Profiles\[profile folder]\cookies.sqlite
Look for a folder called "default" or "default-release" inside Firefox\Profiles.
Microsoft Edge stores cookies here:
C:\Users\[Your Name]\AppData\Local\Microsoft\Edge\User Data\Default\Network\Cookies
Opera stores them here:
C:\Users\[Your Name]\AppData\Roaming\Opera Software\Opera Stable\Cookies
You‘ll notice each browser has its own cookie storage scheme. So cookies set in Chrome won‘t show up in Firefox, for example.
Cookie Locations on macOS
Mac computers also isolate cookies in designated browser-specific folders. However, the location is different than Windows.
On Macs, cookies are stored within the Library folders inside your user profile. To access this area, open Finder and go to:
/Users/[your user name]/Library
Here‘s where Mac browser cookies are found:
Google Chrome –
~/Library/Application Support/Google/Chrome/Default/Cookies
Mozilla Firefox –
~/Library/Application Support/Firefox/Profiles/[profile folder]/cookies.sqlite
Microsoft Edge –
~/Library/Application Support/Microsoft Edge/Default/Cookies
Opera –
~/Library/Application Support/com.operasoftware.Opera/Cookies
Again, the cookies are segregated so those set in Safari won‘t show up in Chrome, for example.
Cookie File Locations on Mobile: iOS and Android
On mobile devices, cookies are stored per browser app rather than accessible system folders.
iOS
You can view and delete cookies through Settings for each browser:
- Safari – Settings > Safari > Advanced > Website Data
- Chrome – Settings > Privacy > Clear Browsing Data
- Firefox – Settings > Privacy & Security > Cookies & Site Data
- Edge – Settings > Privacy, search and services > Clear browsing data
Android
Same idea – manage mobile cookies through the browser settings:
- Chrome – Settings > Privacy > Clear browsing data
- Firefox – Settings > Delete browsing data > Cookies
- Edge – Settings > Privacy, search and services > Clear browsing data
- Samsung Internet – Settings > Privacy > Clear history data > Cookies
On mobile devices, I recommend managing cookies directly through browser settings rather than digging for raw cookie files.
Now that you know where cookies are located, let‘s go over how to view and delete them.
How to View and Delete Browser Cookies (Step-by-Step)
While you can delve into the cookies folders outlined above, it‘s easier to view and control cookies directly through your browser settings. Here are step-by-step instructions to view and delete cookies in the major browsers:
View and Delete Chrome Cookies
Desktop
- Click the 3-dot menu > Settings > Privacy and security
- Click Cookies and other site data > See all cookies and site data
- Review the cookies and click Remove all to delete what you want
Mobile (Android, iOS)
- Tap the 3-dot menu > Settings > Privacy
- Tap Clear browsing data > Cookies, site data
- Tap Clear data to delete cookies and site data
View and Delete Firefox Cookies
Desktop
- Click the hamburger menu > Options
- Go to Privacy & Security > Cookies and Site Data
- Click Manage Data to view cookies
- Select cookies then click Remove Selected to delete
Mobile (Android, iOS)
- Tap the hamburger menu > Settings > Delete browsing data
- Select Cookies and tap Delete
View and Delete Safari Cookies
Mac
- Click Safari > Preferences > Privacy
- Click Manage Website Data > Remove All
iOS
- Go to Settings > Safari > Advanced > Website Data > Remove All
View and Delete Microsoft Edge Cookies
Desktop
- Click the 3-dot menu > Settings > Cookies and site permissions
- Click See all cookies and site data > Clear now
Mobile (Android, iOS)
- Tap the 3-dot menu > Settings > Privacy, search and services
- Tap Clear browsing data > Cookies and cached images
I recommend clearing your cookies at least monthly. More often is even better for privacy, or if you share a device.
Now let‘s explore some best practices for managing cookies securely.
Smart Cookies: A Cybersecurity Expert‘s Cookie Management Best Practices
Cookies provide helpful functionality, yet pose privacy risks if left unchecked. Here are my top tips as a cybersecurity pro for managing cookies securely:
Set cookie expiration timeframes
I suggest configuring your browsers to automatically delete cookies on a set schedule, like every 30 days. Firefox has this option in Settings under Delete Cookies and Site Data. This gives you the usability perks while limiting tracking.
Block third-party cookies
Third-party cookies from ad networks and social plugins deserve extra scrutiny. Consider blocking them altogether or deleting more frequently.
Use private browsing modes
When researching sensitive topics or shopping for surprise gifts, enable your browser‘s private mode like Incognito or Private Browsing to avoid cookie storage.
Say no to tracking
Select the Do Not Track option in Settings whenever possible to limit behavioral profiling. Some browsers like Brave block trackers by default.
Browse anonymously
For maximum privacy, use secure browsers like Tor or a VPN to anonymize your browsing by encrypting traffic and hiding your IP address.
Clear cookies frequently
I recommend wiping your cookies at least monthly. Even more often is wise if you share devices or want to purge tracking data.
Mind mobile cookies
Don‘t forget to check cookie settings on mobile browsers as well as laptops and desktops. Mobile privacy matters too!
Think of managing cookies like cleaning out your car – it works best when done regularly! A quick monthly purge keeps things running smoothly.
The Bottom Line: Cookies Can Be Good With Proper Privacy Precautions
Hopefully this in-depth cookie guide gives you a better handle on what cookies do, where they hide out, and how to take control of them.
While cookies can feel like creepy little spies, they also enable helpful features that make browsing more personalized and convenient. With greater understanding and a few careful privacy precautions, you can enjoy those benefits without compromising security.
As an internet security professional, I‘m amazed by how complex yet functional even simple web technologies like cookies can be. At the end of the day, cookies are like any tool – beneficial when used properly, but requiring caution as well. Just don‘t let them linger too long!