Cookies
Cookies are small text files stored by the browser on a user's device when visiting a website. They contain data that lets the site recognize the browser on subsequent visits — from a session identifier, through language preferences, to information about activity. Cookies underpin many mechanisms of the modern internet, from logging in to analytics.
How cookies work
When the browser first connects to a site, the server can send back a cookie in its response. The browser stores it and, on every subsequent request to the same domain, automatically attaches its contents. This lets the server "remember" the user, even though the HTTP protocol is itself stateless — it holds no information between separate requests.
Cookies fall into several kinds. Session cookies disappear when the browser closes; persistent ones remain for a set time. There are also first-party cookies (set by the visited domain) and third-party cookies, used among other things for cross-site advertising tracking.
Practical use and privacy
Cookies power many key website functions.
- Maintaining a session — they keep you logged in and remember the contents of a shopping cart.
- Personalization — they remember preferences such as language or color theme.
- Analytics and advertising — they measure traffic and enable remarketing.
It is worth distinguishing cookies from other browser storage techniques, such as Local Storage or Session Storage. Cookies are automatically sent to the server with every request, whereas those mechanisms stay entirely on the browser side.
Because they process personal data, cookies are subject to regulations, including GDPR. Sites must disclose their use and obtain consent for non-essential ones. For site owners this means implementing a consent banner and a transparent privacy policy.
Powiązane pojęcia
Najczęstsze pytania
How do session cookies differ from persistent ones?
Session cookies are deleted when the browser closes and store data only for the duration of the visit, such as cart contents. Persistent cookies remain on the device for a set time and remember preferences or logins across visits.
Must a site ask for consent to cookies?
Under GDPR and privacy rules, a site must obtain the user's consent for cookies other than those essential to its operation, such as analytics or marketing. Technical cookies necessary for the site to function do not require consent.
