A cookie is a little information sent by a website and stored in the user's browser, so that the website can check the user's previous activity.
Its main functions are:
Take control of users: When a user enters their username and password, a cookie is stored so that they do not have to be entered for each page of the server. However, a cookie does not only identify a person, but a combination of computer-browser-user.
Get information about the user's browsing habits, spyware attempts (spyware), advertising agencies and others. This can cause privacy issues and is one of the reasons why cookies have their detractors.