Cookie

Definition

What is a cookie?

 

A cookie is essentially just a text file that contains data—such as a username and password—used to identify a device as it accesses a server or computer network.

 

If you wish to gain a more in-depth understanding of this concept, check out the FAQ section below:

 

Question #1: Is there more than one type of cookie?

 

Yes, there is more than one type of cookie. We have magic cookies and HTTP cookies.

 

The term ‘magic cookies’ refer to the packets of information sent and received with zero alterations. They are commonly used with logins to things such as a company’s internal business network.

 

HTTP cookies, on the other hand, as the name suggests, are the type of cookies used for internet browsing. First appearing in 1994, the HTTP cookie was created by Lou Montulli based on magic cookies to help an e-commerce website solve their server overloading problems.

 

Today, we use HTTP cookies to manage and improve our online experiences.

 

Question #2: What is a cookie used for?

 

As we have seen earlier, a cookie is primarily used to store and exchange information. In the case of HTTP cookies, the types of information stored and exchanged include:

 

  • Your login information
  • Your preferences
  • Your session information (e.g., any items you had in your online shopping cart)

 

The goal here is to make it easier for a server to quickly identify who is accessing it and provide them with the exact type of content they are looking for—which, as a result, benefits the user too.

 

Just think how much of a hassle it would be, for example, if HTTP cookies did not exist and you could not save your login information on any of the many websites you use. Every time you had to open your email or social media accounts, you would have to input your username and password.

 

Question #3: What are the benefits of cookies?

 

The benefits of cookies can be broken down into two main categories:

 

  1. Server
  2. User

 

Cookies benefit servers by allowing the latter to minimise the amount of user data it has to store without compromising the overall user experience. If cookies did not exist, servers would have to save everything about each user locally. Now, while this may not sound like a big deal for smaller websites, for one that gets, say, 100,000 visits per month, things could get messy very quickly.

 

Of course, the server can just forego saving any information altogether to save space, but forcing visitors to, say, re-enter their login information every time they drop by makes for a terrible user experience and is a great way to lose users.

 

As for users, on the other hand, as we have seen earlier, cookies make their browsing experience so much better. Aside from not having to relog in to every website every single time, cookies also make it possible for them to enjoy personalised experiences and other conveniences, such as having the contents of their online shopping carts saved.

 

Unfortunately, despite these benefits, cookies are not always a good things—which brings us to the next point:

 

Question #4: Are cookies unsafe?

 

In certain situations, yes, cookies can be unsafe, especially if they come from questionable sources.

 

In most cases, first-party cookies (i.e., the ones from the website you are accessing) are safe, provided the website you are visiting is reputable and has not been compromised.

 

In contrast, the third-party cookies that come from advertisers on the websites you visit may not be as harmless. Even if you do not actually click on any ads, these advertisers could still collect information about you without your knowledge. And to make matters worse, if you encounter their ads on more than one website, they will be able to build a more accurate profile of your personal preferences and browsing habits.

 

Finally, there is also such a thing as a zombie cookie. Unlike the first two, you cannot opt out of receiving this type of cookie. It is automatically (and permanently) saved on your device and is extremely challenging to remove, often reappearing even after being deleted. This means you will need an actual antimalware tool to get rid of it for good.