Cookie
is a small piece of data that a website stores in a user's browser, which the
browser automatically sends back to the same site with subsequent requests.
In simpler terms: it’s a way for a website to “recognize”
you across different pages and visits.
Why are cookies used?
Authentication and sessions
For example, when you log into your account, the site stores a session identifier
in a cookie. As long as that cookie exists, the server knows it’s you.
Storing preferences
Such as site language, theme (light/dark mode), region, currency, etc.
Shopping carts in online stores
Items in your cart can be stored via cookies (or through
a combination of cookies and server-side storage).
Analytics and advertising
Cookies are used to collect visit statistics,
track user behavior, and display personalized ads.