A cookie is a small piece of data a website stores in a browser and sends back on later requests. It helps a service remember login state, preferences, shopping carts, and other session information. In cyber security, cookies matter because many of them carry session identifiers or tracking IDs. If an attacker steals a session cookie, they may be able to impersonate a user without knowing the password.
Cookies are commonly targeted through phishing, cross-site scripting, malware on an endpoint, or insecure network handling. Defenders reduce risk by setting the Secure, HttpOnly, and SameSite flags, using short-lived sessions, rotating tokens after authentication, and limiting cookie scope with domain and path controls. Security teams also inventory cookies and related browser storage because tracking and telemetry can create sensitive data flows even when no obvious malware is present.


