What are the different types of cookies? 

Cookies can be classified based on the following:

  • Purpose: necessary and non-necessary cookies
  • Origin: first-party and third-party cookies
  • Duration: session and persistent cookies

Necessary cookies are essential for a website to function properly; their absence may result in the malfunctioning of various features of the site. E.g. cookies that confirm whether or not a user is logged in.  Non-necessary cookies, often added by the website itself, can provide additional services, like tracking your interests and serving pop-up ads.

The first-party cookies are set by the website itself that the user is currently visiting. They are used for services like checking login status and holding shopping cart items. The third-party cookies are set by other websites or third-party tools to track user behavior on the current site. E.g., Google Analytics cookies that track users for measuring conversions.

Session cookies are temporary in nature and expire after a session ends. Persistent cookies, on the other hand, stay on a user’s browser until they expire. Unlike the session cookies, persistent cookies hold items in the shopping cart even after the users close their browsers so that they can access them on their next visit.