Accept Cookies? Or Not?
Tags: productivity, womenintech, webdev, beginners
Published: 2021-06-04 07:40:22

If you are a regular visitor on the internet, browsing through different websites might have made you come across the term “__Cookies__”, right? There you are asked to click onto some buttons saying - ‘__Accept Cookies__’ or ‘__Manage Cookies__’ or sometimes ‘__Ok, Got it!__’. 

Well, it’s not the Cookies we eat but, it is something without which we will be unable to login to websites.
 
Feeling skeptical? Let us uncover the facts!

_Cookies are small packets of information or texts that a web browser stores on a user’s hard disk (here we say, computer)._
 
In an easier way it can be said that Cookies allow a website to store information on your machine and later retrieve it once you re-visit the website in future, therefore giving you a better experience in browsing.

__Hey, wait! But why do we exactly need cookies?__

You need cookies because…

•It keeps track of all your activities in a particular website, so that, you can be served in a more personalized way. You can think of cookies as your _note-taker, who logs and keeps track of your activities on a particular website._ Sounds quite convincing, doesn’t it?

__But, Why are cookies important?__

The several important jobs of the cookies are:

•To keep you logged in by recognizing your computer whenever you visit the website.
•To track your activities as you navigate the website (don’t worry, not for malicious attacks), to enable other facilities.
•To improve the website’s usability.
•To personalize so that the next time you visit the site.

When you visit a website, you are asked to login. You fill the username and password section and login to that website. Now when you visit the website again, you are not asked for your username and password to login again.
 
##WHY?##
 
Because, the website remembered you through the cookies which stored your username and password in form of ID (as every cookie has its own unique ID) on your machine.

Now you might be curious about…
 
__**How do Cookies work?**__
 
Let’s understand this with an example.

You visit a shopping website and there you are asked to click on __‘_Accept Cookies_’__ or sometimes may be not. You click on that. Then the cookie starts tracking all of your activities on that website. 

Suppose you thought of purchasing a new phone. You were searching for one and you shortlisted few phones, matching your requirements.
Let’s assume that you got caught up with some work and had to close the website in between.

Later, when you start browsing some other website, the website eventually starts showing advertisements related to that item you shortlisted on the shopping website.
 
_Now, don’t you want to know, how did that happen?_

The moment you opened the online shopping website, the website stored a cookie on your computer. The cookie kept on tracking all of your activities in that website from the beginning to the end, so that _the website can show you similar suggestions or even coupons which might help you get a cashback!_ 

The above example showed one of the many ways, of how a cookie works.

Let us have a break and look at these pictures below.

![Fig. 1: Browsing Without Cookies](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6mln7bhhuj1li4nrqzms.png)

**Fig. 1: Browsing Without Cookies**

![Fig. 2: Browsing With Cookies](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtc1c2waxrwa4jx7m9oi.png)

**Fig. 2: Browsing With Cookies**

Moving forward, we can see that, _Cookies have their types as well!_
 
#What? They even have types?#

Yes! 

It is not mandatory that only after you click on __‘Accept Cookies’__, the cookies start working.
 
No! These virtually invisible cookies are all very different from each other. You might find some other types as well but, as a casual user and also as a beginner, these are some of the common types you might want to explore:

1.Session Cookies
2.Persistent Cookies
3.Third-Party Cookies

__Session Cookies__: These cookies are the __Temporary Ones.__ They memorize your online activities, as websites don’t really have any memory of their own. This is because of the session cookies, why you do not have to login to the same website after you close it, as your username and password gets stored because of the session cookies.
 
_A good example of session cookies is online shopping website. You add an item to your cart and close the website. When you visit the website again, you see the item still present in your cart. Later when you check out, your cart becomes empty. 
Do you wonder, why? Because, the session cookies remembered your activity and worked accordingly._
 
__Persistent Cookies:__ They are also known as the __First-party Cookies.__ These cookies work by collecting data according to your preferences to improve your (user) experience. 
Curious?
 
Let us understand with a short example.

_Suppose you have logged in to Facebook for the first time, you don’t like its default settings. You changed the language settings and theme settings from default to dark theme, as dark theme is the new trend! Then you log out from Facebook. After a while when you login again, you find your changes are saved __as per your preferences and they are not lost__. All thanks to Persistent Cookies!_

__Third Party Cookies:__ These cookies are placed on a website so that, the website could collect all the user data for the third party.
Haven’t you wondered about the relevant ads you see on any website you visit?

Okay let me break the ice for you.

_You search for a product on the shopping website. After a while, when you open another website, you find the relevant products’ suggestions hovering around some corner of the website, don’t you?_

Now that you are aware of what Cookies are, there types and also how they work, a question might arise, about __SECURITY.__ As we are always concerned about our security, hence we make sure that our data is in safe hands. BUT! If we are accepting cookies, should we not worry about our security?

Yes, We should!
 
_These cookies basically track our activities to give us a user-friendly experience, __they are not harmful in themselves. They don’t infect computer with viruses or other malware__ but, some malicious actors can hijack those cookies and use it for their own purpose._

Scared? No need to worry!

To avoid this fraud, what should you do?

To steer clear of this situation, it is recommended not to click BLINDLY on "Accept Cookies" and also it is necessary to keep your browser up to date as many cookie scams are designed to happen in outdated browsers.

As a whole, Cookies are a good thing for a more pleasurable browsing experience.
 
_Have a safe browsing!_