Every weekend, either on Saturday or Sunday, I visit a small café just three kilometers from my home. It’s been part of my routine for the last ~ three years.
Whenever I walk in, I don’t even have to say a word.
The waiter sees me, smiles, and brings me my regular coffee: an Americano☕️ with no sugar.
He simply knows what I like.
One day, I realized this is exactly how cookies work on the internet.
So, What Are Cookies? 🍪
In the tech world, cookies are small pieces of data that a website saves in your browser.
When you visit a website for the first time, it might remember:
The language you chose
Whether you're logged in
Items you added to your cart
Pages you visited
Then, when you come back later, your browser shares that saved data with the website.
This helps the site show things the way you like them, without asking again.
Just like how my café knows I want an Americano, the website knows your preferences too. That’s what cookies do.
What Do Cookies Actually Store?
Here are some common examples:
✅ Session ID – So the site knows you're already logged in
✅ Preferences – Like dark mode, font size, or selected language
✅ Authentication Tokens – Used to keep you logged in (safely stored with security flags)
🚫 Passwords – Cookies should never store plain passwords
These cookies are stored in your browser (like Chrome, Safari, or Firefox), and they are automatically sent back to the website when you revisit it.
🔐 What About Privacy?
You’ve probably seen websites asking you to “Accept Cookies.”
This is mainly because cookies can also be used for tracking, especially when used by ads or social media tools (called third-party cookies).
To protect your privacy, many countries have passed laws that require websites to ask for your consent before saving cookies.
Some well-known laws are:
GDPR in Europe
CCPA in California
Cookies are helpful, but they should be used responsibly.
What Should a Test Engineer Know About Cookies?
As a Test Engineer, cookies aren’t just about preferences, they’re part of your test checklist.
1. Check if Cookies Are Created and Deleted Properly
A café shouldn't remember your order forever — websites shouldn’t either.
Are session cookies deleted after logout?
Are persistent cookies using proper expiry dates?
How to check:
Dev Tools → Application → Cookies tab → Inspect creation & expiry
2. Test for Secure and HttpOnly Flags
Are cookies marked
Secure
? (sent only on HTTPS)Are
HttpOnly
cookies used to prevent JavaScript access?
Why it matters: Protects users from XSS attacks
3. No Sensitive Info in Cookies
No plain-text passwords
No exposed personal data
No token leakage
Use dev tools or tools like Burp Suite to validate this.
4. Behavior Across Sessions
You change your coffee order one day, but they still serve the old one?
Do updated preferences reflect in cookies?
Do cookies behave consistently across tabs, devices, and browsers?
5. Language & Localization Testing
If your site supports multiple languages:
Switch to another language → Refresh → Does it persist?
Clear cookies → Does the site go back to default?
6. Third-Party Cookie Testing
Are trackers (ads, analytics) saving cookies?
Are they still present even after rejecting cookies?
Use privacy tools or browser extensions to inspect third-party behavior.
7. Cookie Consent Testing
Does the cookie banner appear only once?
Are cookies blocked before consent?
Can users reject non-essential cookies?
Final Words
Cookies are like that kind waiter at my café.
They remember your choices, save your time, and make your experience smoother.
But for a test engineer, cookies also mean:
Security checks
Session validation
Privacy compliance
Accurate behavior testing
So next time you're testing an app,
don’t just sip the coffee...
Check the cookies too. 🍪☕️
If you found this helpful, stay connected with Life of QA for more real-world testing experiences, tips, and lessons from the journey!