What are cookies, how they work and why they are needed?

2 months ago · 0 comments

A quick guide to managing your online privacy.

The word "cookie" is translated from English as "cookies". However, we will not talk about flour confectionery products in this article.

Cookies are widely used on websites and are an essential component of today's Internet. They are very useful in many ways and improve the user experience of interacting with websites, but they can also pose a threat to privacy and personal information.

Now we will look at what cookies are, why websites use them, how they work in the browser, and how to reduce the risks of using them.

What are cookies?

In simple terms, cookies are data that is stored in the memory of a computer or mobile device when you visit websites. They are stored as plain text files and are used to help a website remember user information. For example, his Internet preferences or authorization data.

Any data that is stored in cookies is created by the web server every time you visit the site. They are marked with a unique identifier that helps the server and the site understand what information to provide to the user.

How do cookies work?

When you visit a website for the first time, the server sends a certain cookie to the device from which the connection was made. Each time you visit the same site again, the browser sends this cookie back to the server to identify the user. And the server, in turn, issues a version of the site adapted to the previous history of visits.

Why do websites use cookies?

Cookies are used by websites for a variety of reasons:


Cookies help a website remember the user's personal information and provide data based on user preferences. For example, a website may use cookies to remember that the user's preferred language is English and that the user's preferred interface theme is dark. The site will automatically open in this view each time thanks to cookie technology.


Enabling cookies can make it easier for users to access accounts on the site. Since cookies may contain data with login information, the user will not need to enter his credentials each time he visits the site. The session will be saved until the user himself logs out of the account or clears cookies in the browser.


Marketers often use cookies to track users who open certain pages and otherwise interact with the site. This information can be used to improve server performance or better understand user behavior on the site.

Target ads.

Cookies are often used to serve ads based on your browsing history. For example, if a user visits a website to find out about an upcoming tourist trip, this cookie can be used to display travel ads on other websites in a common network. This principle works, for example, advertising Google or Yandex.

What types of cookies are there?

There are two common types of cookies that websites use:

• Persistent cookies

Persistent cookies are used to authenticate and personalize your browsing experience. They contain information about login credentials, settings, theme choice, and the user's language preferences. A good example of persistent cookies is a shopping cart in an online marketplace. You can even not create an account on the site, but add the desired products to the basket, and they will not disappear anywhere the next time you visit the site.

• Session cookies

Session (temporary) cookies are created by a web server and are used to store information about the user's current session. Session cookies store information about the user's movements on the website and only track input during an active session. At the end of the session, these cookies are deleted from both the device and the web server.

Should I disable cookies or delete them manually?

Worth it or not - everyone decides for himself. Many users disable cookies on any site in order to provide greater privacy and anonymity on the Internet. In any case, this may affect the user experience when browsing the site, since deleting cookies will reset user settings and preferences that are not stored on the server.

Can cookies be harmful or dangerous?

The data in cookies is not dangerous in and of itself and cannot be used to infect malware. However, if cookie data falls into the wrong hands, attackers can gain access to browsing sessions, steal personal information, or otherwise misuse cookies.

Cases have been documented of attackers stealing a user's valid cookies and intercepting their active session, giving full access to the victim's account.

While most sites will automatically log users out after a period of inactivity, sometimes it pays to play it safe. For example, if we are not talking about an ordinary user account, but about a site administrator, it is worth clearing cookies regularly so that attackers cannot use them.

What is "cookie stuffing"?

Speaking of cookies, it's also worth mentioning "cookie stuffing" or "cookie spoofing". This method is called the introduction by attackers on a hacked website of hidden iframes with affiliate links. For example, hackers were able to hack the site of a popular marketplace and change its code by introducing a referral system that pays commissions for purchases. When visiting hacked pages, cookies with third-party code including referral links will be loaded in the background, and if the user makes any purchase on this marketplace, the attackers will receive affiliate income. For the user, this type of fraud is harmless, and for fraudsters it is a real gold mine.

Should you allow cookies on all websites you visit?

As mentioned earlier, the use of cookies can greatly improve the user experience on websites. Especially those who visit regularly. However, the issue of data privacy has been raised more and more in recent years, and more and more sites use cookies.

We suggest that you familiarize yourself with the list of the pros and cons of cookies in order to be able to make an informed decision on this issue:

• Pros:

Shopping on the Internet. Almost all e-commerce sites allow users to put items in their shopping cart and not lose them when they visit the site again.

Submitted forms. Cookies can remember information sent on the site, such as name, phone number, email address, etc. This can save you valuable time when you use the site later.

Personalization. Cookies help to save site settings that are convenient for a particular user. For example, language, interface theme, etc.

Recommended content. Cookies are widely used for recommendations. For example, they can be compared with data from other users who have a similar profile and then used to personalize offers of certain goods or services. Sometimes this is helpful.

Security authentication. On sites with disabled cookies, you will have to log in to your profile each time you visit them again. Therefore, the use of cookies in this situation improves the user experience and saves time.

• Cons:

Confidentiality. Most browsers are set to accept cookies by default. And since cookies can be stored, including on a web server and used by third-party sites, the history of the pages visited by the user and the IP address under certain circumstances may become public.

Local storage. Website cookies take up a certain amount of space in the device's local storage. If you do not clear cookies at all for a long time, the space occupied by the browser can cause a lack of memory on the device.

Unauthorized data collection. Unscrupulous website owners may sell the information collected by cookies to third parties or use it to hack into social networks or other online accounts.


The use of cookies certainly has its advantages, but it is not without its drawbacks. Do not neglect the regular cleaning of cookies on your devices to protect yourself and your data.

Google, for example, has announced its plan to phase out all third-party cookies in Chromium-based browsers by 2024, with plans to use a different technology that is more forgiving of user privacy. This step says a lot and makes you think about the appropriateness of using cookies in the current Internet realities.