Http Cookies

Ever visited a website and been asked to accept cookies? Obviously yes. What's your action when you see this, do you accept all cookies or check out their cookie policy to know the cookies they want to store on your device or do you just exit the website? You are most likely going to do the first.
In this article, I'm going to explain what cookies are, why we need them and the various kind of cookies used by websites.
WHAT ARE COOKIES
Assuming as a Nigerian I travel abroad to... let's say Spain. Then I go to a restaurant and try ordering something but language became a problem because I don't speak Spanish, I only speak Igbo and English. Luckily for me, one of the waiters speaks English and he attended to me. The next day I went to the same restaurant and the workers there recognized me as the foreigner that visited the previous day. The waiter who attended to me yesterday was assigned to me again because he is the only one that I can communicate with. We had a little chat while I was placing my order and he discovered that I’m a Nigerian with this information, he recommended some foods that other Nigerians who had visited the restaurant liked. He also made recommendations based on the food I ordered the previous time. This is exactly what cookies do.
HTTP cookies are small pieces of data from a website stored on users’ devices while they browse the website. This is how it works, when you visit a website for the first time, the website puts a cookie with a unique ID code on your device browser and uses this ID code to keep track of your activity on the website, like the post you act on (liked or shared) and content you viewed, so they can recommend more contents like that. The unique ID is also used to remember you and to keep you logged in.
The first cookie was invented in 1994 by a programmer named Lou Montulli. Before now, users' information, like items in their shopping cart was stored on the website server but this took a lot of server space and money. Lou Montulli came up with a way to store that information on users’ devices. He recreated Magic Cookie, a computing token used to identify when a user logs into a system by passing small bits of data between the server and the computer. This is how HTTP Cookies came to be. Just like the Magic cookie, HTTP Cookies are used to identify a computer but it has added functions.
WHY DO WE NEED COOKIES
Hypertext Transfer Protocol (HTTP) is Stateless meaning that it doesn’t retain information from the previous session and when a session ends, the connection between the browser and the server is lost. Imagine having to put your username and password for every page you visit on Facebook while browsing through it. How do you think the experience Will be? Cookies are here to take away such awful experiences.
HTTP is incapable of remembering you or your preference settings thus the need for cookies. Cookies are used by a website to keep you logged in, to remember your language preference, to track your browsing activities to make recommendations for you and to serve you ads that interest you. Website owners use cookies to keep count of visitors of the site. Cookies are website specific.
Varieties of cookies used by websites are;
Session cookies. These cookies expire once the session ends.
Persistent cookies. They are stored in your browser and are used to recognize you as an existing user.
Essential cookies are necessary to carry out operations on the site. It may be used to authenticate users and prevent unauthorized access to a user’s account.
Analytics cookies are used to count the number of visitors that visit a website and how they interact with the website.
Functionality cookies are also called preference cookies. They are used to recognize you when you next visit and to remember your choices, like your language preference. They remember your password and username to automatically log you in. Some websites greet you by your name, these cookies help them do that.
Targeting cookies. These cookies track your browsing activities to gather information about the contents you like and follow to serve you advertisements based on topics that interest you.
FIRST-PARTY Vs THIRD-PARTY COOKIES
First-party cookies are cookies placed on your browser by the website you are directly browsing. They are created to enhance your experience when you use their website. Third-party cookies are placed on your browser by websites other than the one you’re currently or directly browsing. They aim to track you and serve you targeted ads based on your online activities. Though Cookies are website specific (meaning that cookies of a website can not be read by another website), Third-party cookies have devised a means to track you around the internet. For instance, you are browsing a shopping site that has a Facebook like button, when you click on the like button, the shopping site downloads a code from the Facebook website that enables it to read Facebook cookies. Through these cookies, Facebook now knows that you visited that shopping site.
Cookies were made to make our lives easier and to improve our experience when browsing the web. But everything that has an advantage has a disadvantage too. The disadvantage of cookies is that they constitute a digital privacy breach. They also pose a security threat. If a cybercrime actor gets hold of the cookies stored on your device, he/she may be able to get the login credentials to your various online accounts. So it is advisable to always clear your cookies.




