A cookie is a small text file stored on a user’s computer or browser when they visit a website. It allows the website to remember information such as login credentials, user preferences, the contents of a shopping cart, or visit history. Cookies can be placed by the website visited (first-party cookies) or by third parties (third-party cookies) such as advertising networks or analytics services. They play a vital role in personalizing the user experience, security, and targeted marketing, while remaining subject to regulations designed to protect user privacy.