What is a cookie?

A cookie is a text-only string of information that a website transfers to the cookie file of the browser on your computer’s hard disk so that the website can remember who you are. Each time you open a website that uses cookies, it checks to see if a cookie is already stored locally on your computer - If it is, then it can use that to find out some information about you.

A cookie will typically contain the name of the domain from which the cookie originated, the “lifetime” of the cookie, and a value, usually a randomly generated unique number. Mainly two types of cookies are used on this website, namely -session cookies, which are temporary cookies that remain in your browser until you leave the site, and persistent cookies, which remain in your browser for much longer (though how long will depend on the lifetime of the specific cookie - anything from several days to the end of time).

Cookies can help a website to arrange content to match your preferred interests more quickly. Most major websites use cookies. Cookies cannot be used by themselves to identify you, they are only used to optimize content based on your past interests and experience on the particular website.

Are all cookies the same?

There are two different types of cookies: Session cookies - These are temporary and are erased when you close your browser at the end of your surfing session. The next time you visit that particular site it will not recognize you and will treat you as a completely new visitor as there is nothing in your browser to let the site know that you have visited before. One example is called ‘PHPSESSID’, for “PHP Session ID” - meaning if by accident, say you close the tab, when you reopen the website it can use this cookie to continue your session from where you left off. (PHP simply refers to the language PHP in which the server uses the session ID)

Persistent cookies - These remain on your hard drive until you erase them or they expire. How long a cookie remains on your browser depends on how long the website has programmed the cookie to last. Various websites use this to, for example store the user’s location to show them customized advertisements.

What are session cookies used for?

Without cookies, websites and their servers have no memory. Obviously, any sane website is not going to store information about thousands, even millions of users on their database. Not only will it be quite expensive but also slow down performance. A cookie, like a key, enables swift passage from one place to the next. Without a cookie every time you open a new web page the server where that page is stored will treat you like a completely new visitor.

Websites typically use session cookies to ensure that you are recognized when you move from page to page within one site and that any information you have entered is remembered. For example, if an e-commerce site did not use session cookies then items placed in a shopping basket would disappear by the time you reach the checkout. You can choose to accept or deny session cookies by changing the settings in your browser.

What are persistent cookies used for?

A persistent cookie enables a website to remember you on subsequent visits, speeding up and enhancing your experience of services or functions offered.

For example, a website may offer its contents in different languages. On your first visit, you may choose to have the content delivered in French and the site may record that preference in a persistent cookie set on your browser. When you revisit that site it will use the cookie to ensure that the content is delivered in French. The “Remember Me” function on a website sets these kind of cookies.

What can’t cookies do?

Because cookies are just harmless plain text files, or keys, they cannot look into your computer and find out information about you, your family, or read any material kept on your hard-drive. Cookies simply allow a website to recognize users when they return to a site by opening different doors to different contents or services depending on your “key” (cookie). It is technically impossible for cookies to read personal information.

If you would like to see more content like this, please consider supporting me on Patreon.

go to top