Modified: August 02 2024


Link to Cloudflare, super helpful resource.

A cookie is a piece of data sent from a web server to a web browser filled with information about the client and session, created when the request was sent from the client to the server.

The three main reasons why you’d want to use cookies would be:

  1. Session Info: Storing the session info in the cookie allows you to do things like refresh the page or link to another page without having to retype in your user information.
  2. Personalization: Cookies will actually track the things you do on websites that are custom or personal to you, and even remember the interaction so it will prompt your information to log-in again, instead of another user.
  3. Tracking: The first two sort of count as tracking, but in a more literal sense. Take for example; how do adds on other websites know you’ve been shopping for a certain product on Amazon? Third-party tracking cookies.

There are also different types of cookies:

  • Session: Meant to track the user’s session. They have no expiration date, which lets the browser know they should be deleted once the session is determined to be over (usually through a log-out method, or a page close).
  • Persistent: Cookies that stay in the browser for some fixed length of time. They must have some expiration date however, so they’re certainly not infinite.
  • Authentication: Meant to maintain sensitive user info, usually log-in information.
  • Tracking: Meant to record user activity.
  • Zombie: Exactly what it sounds like, cookies that come back from the dead. Cookies make backups of themselves, so even after deleted more are made. Usually made or sent by ads or hackers.