Why do websites use cookies?
The short answer
A cookie is a small piece of information a site asks the browser to store, often for settings, sessions, or a shopping cart.
How it works
Cookies have attributes such as an expiration and scope, and they do not all serve the same purpose. Browsers can delete or restrict them.
A familiar example
Deleting cookies can also remove saved settings or login sessions.