Whats a cookie in the web?

844 views

Whats a cookie in the web?

In: Technology

7 Answers

Anonymous 0 Comments

Eli5: Imagine you are at a store where all the goods are kept behind a black wall. There is a shopkeeper behind that wall, but you can’t see them and they can’t see you.

Let’s say you need to run out to your car to get your wallet, but you’ve already picked out a bunch of items. You want to tell the shop keeper to keep these items safe for you, but they don’t know what you look like. So the shop keeper writes on a little piece of paper some secret information that would be very hard to randomly copy and a list of the items that you had.

When you return, you show the shop keeper with ticket the shop keeper gave you, and the shop keeper recognizes you and gives you all the items back to keep looking around the store. When you leave, the shopkeeper says they are running a rewards program and gives you a piece of paper before you leave that uniquely identifies you so that the shop keeper can look you up next time you come in and make sure you get all the benefits. You leave the store, but you keep the piece of paper to present the next time you are shopping there.

Imagine now that these papers can automatically add new information to themselves, “client picked up a vacuum cleaner and marveled at it, but did not buy”. “Customer waited for 1 minute at the till before canceling purchase”. Furthermore, you don’t even need to ask for them from the shopkeeper, and you dont need to show them to the shopkeeper, this behavior happens automatically when you leave and enter a store. Every store will say “do you consent to use papers”, if you continue then they will do it without asking again.

When it returns this information to the shopkeeper as you leave, the shopkeeper thinks, hmm this person wants to buy a vacuum, but they did not purchase one. Imagine now that this shopkeeper has many different stores, some are for entertainment or other purposes, but all maintained somehow by the same shopkeeper. You come to one of their establishments and they automatically collect your papers. Suddenly one of the advertisements that was on the wall changes from dog food to a vacuum cleaner, the exact model you were looking at.

You are your computer, the shops are the websites that you interact with, the shopkeeper is the server you are talking to, and the pieces of paper are the cookies.

Less ELI5: Originally they were designed as a way to authenticate users to maintain sessions (a fancy word for not completely resetting all the content of a web page when you leave and come back, things like shopping carts) and maintain bits of information.

The thing to remember is that both the client side code (web page you interact with) and server code is written by the same people. So whereas in our example, the shop keeper had to give you the paper, and you had to choose to return the paper, this behavior is automated by the seller, and the seller doesn’t have to tell you what they are maintaining about your visit. The only authorization you have when you enter a store is “do you want to receive papers that remember you and enhance your experience?” (do you want to enable cookies?)

Nowadays these cookies maintain MUCH more information than people may like, but they can only collect information from you that

A) the browser will give freely or
B) interactions with their site

This is why it is important to check what information your browser freely shares. You can modify this to keep a stronger privacy and ensure the only thing sellers are taking from you are interactions with their website.

Edit: note that one of the features of private mode or incognito mode is limited cookies. Some maintain the cookies until you close the browser, some will not save them at all. But they never use existing cookies. Browse around on some of your favorite sites in private mode and interact a bit. Leave the sites (maybe close the window and reopen in private) and come back and notice how many quality of life features disappear. The sad part is that most sites are hardly functional without cookies. Simply disabling them isn’t really an option for most users.

You are viewing 1 out of 7 answers, click here to view all answers.