A cookie is a small piece of data that a website stores in a browser to remember preferences, sessions, or activity.
A browser remembers a small value
A website can ask a browser to store a cookie and send it back on later requests. That supports sessions, preferences, language choices, and some forms of measurement.
Not every cookie does the same job
First-party cookies belong to the site being visited, while third-party tracking has different privacy implications. Expiration, consent, security flags, and the data stored all affect responsible use.