Nearly every website you visit attempts to store cookies in your browsers. Most are safe and provide helpful functionality to make web browsing more accessible.
It may sometimes feel invasive, but cookies serve a valuable purpose. They help tailor website experiences to our tastes. And they enhance usability by storing information like form data, preferences and activity.
To keep criminals’ hands out of the cookie jar, developers now generate an ‘HTTPOnly’ flag. This safeguard stops a cookie from being transferred over an unencrypted HTTP request, preventing cyber criminals from coopting it.
There are 3 types of cookies:
- A Persistent Cookie makes it easier to log in to a website by storing information such as username and password. This cookie may stay in the browser for an extended period but always comes with an expiration date.
- The First-Party or Session Cookie only exists as long as a browser stays open. This cookie keeps items in a shopping cart, even when the user navigates to another page. By design, this type of cookie is deleted when the browser is closed.
- Third-party cookies are commonly known as tracking cookies. Advertisers use them to collect data and display ads based on browsing behavior.
How cookies work
The server sends a page with a cookie when a browser requests a website. The cookie—a tiny text file—is then stored on the local hard drive.
In the case of persistent and third-party cookies, the browser associates the cookie with its corresponding website when a viewer returns to the same site. At that point, a website can issue instructions to the browser like “fill in user name” or “render website in Spanish.”
The acceptance and customization of cookies on a given site are stored as — wait for it… a cookie. Go figure.