What exactly are cookies that websites are using?

798 views

What exactly are cookies that websites are using?

In: Technology

6 Answers

Anonymous 0 Comments

When you visit a library, the library issues you an ID card. This is like a cookie. A web server issues cookies to you to personalize your experiences on their websites. You use your library card to check out a book, and over time the library recognizes your choices and can make suggestions for you based on that data. Cookies are sent back to the server when you visit it and thus the sites cater more to your choices. If you use amazon, you’ll see the part of the page that suggests items to you based on your cart items, that’s what cookies can do. It makes the websites you visit closer aligned to what the server thinks you need.

Anonymous 0 Comments

A lot of them track your web browsing for the purpose of targeted advertising. When you click the “agree” button on a website’s cookie disclosure message, this collection of information is the most important thing you’re agreeing to. (In the past, they were allowed to do this without having you agree. Now, they have to give you that message box.)

Cookies also have practical uses such as remembering your login info between visits, remembering information you’ve entered somewhere, remembering items in your shopping cart, etc.

The upside to cookies is convenience while the downside is letting websites see your web browsing.

Anonymous 0 Comments

They are like small notes that the website asks your browser to keep and give back to the website next time you visit it.

They are typically things like your personal settings on the website, your choice of language etc. but they can also hold information that proves who you are to the website so you don’t have to type your password in every time you click on a link.

Anonymous 0 Comments

Cookies are small text files that websites can use to store data in. This can be an identifier so the website can remember you between sessions, settings you’ve set for that website, statistics for games if it’s that sort of website, and so on. Anything that the website might want remember about you, but isn’t practical to store on the server itself.

Anonymous 0 Comments

A (browser) cookie is a small piece of information that a webserver can give to your browser to be stored. From then on, each time your browser makes a request to that webserver, it will also send back that cookie.

Why does it do that? Because the World Wide Web uses a [stateless protocol](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol). It means, that every time you load a page, a request is sent to the webserver. The webserver deals with the request, sends back the response and then suffers a severe case of amnesia. The webserver is done with that request and as far as it’s concerned your next request could as well be your first one or someone elses. This design solves a practical problem for the webserver. You see, you never know, if a visitor will ever come back or not. If you’d use a stateful protocol, where the server needs to remember stuff about visitors, how long do you need to store that? When do you know, the information is no longer needed?

Of course, that creates a problem for the browser. If the server always forgets your stuff, how do you implement something like a virtual shopping basket? You add an item, it immediately forgets that item … yea that’s not going well.

Cookies to the rescue:

* Visitor: Hi webshop, please show me your catalogue
* Webshop: Hi visitor! Here’s my catalogue. Btw., you’re visitor “TD45A7”, please remember that
* Visitor: Hi webshop, please add item 254 to my shopping basket. Btw., I’m “TD45A7”
* Webshop: Thanks “TD45A7”, one item added to your shopping basket. You have one item in your basket.
* Visitor: Hi webshop, please add item 634 to my basket. Btw., I’m “TD45A7”
* Webshop: Thanks “TD45A7”, one item added to your basket. You have two items in your basket.

A cooky can contain all kinds of information. A unique visitor number, like in the example above. Or your preferred language so you don’t have to choose the language again next time you visit.

Anonymous 0 Comments

Cookies are normally used to save certain settings, so that when you go back to the same website you don’t have to change them again. For example, you can remain logged in to any site that you have an account with. Sites like YouTube will remember your dark/light mode preference. Etc.