An HTTP cookie, commonly referred to simply as “cookie(s)”, is a packet of information, in the form of a small text file, that is sent from a web server to your Internet browser, and then returned by the browser each time it accesses that same server/website. Cookies are useful because they allow the website to recognise the visitor when they revisit the website and store their preferences for that site.
When a cookie does not have an expiry date or period, then it is session/temporary. The browser recognizes a cookie as a session cookie if it is missing the Expires and Max-Age attributes. Once the visitor closes their browser, the session cookie is deleted. The site may remove session cookies from the browser, for example when the user logs out of the site or remains inactive for a period of time.
Where a cookie has an expiry date and/or period, then it can be defined as ‘persistent’. This means that the cookie is not deleted when you close the browser.
Persistent cookies can also serve sites to remember and distinguish their visitors. Most often for personalization, collecting access statistics, improving site usability and user experience. As well as for other purposes that do not require users to be specifically identified by their personal or authentication information (user, password).
For example, Google Analytics uses such cookies to distinguish between new (unique visitor) and returning (returning visitor) users of a website.
Third Party Cookies
Third party cookies are a type of cookie. The more aggressive third-party cookies are those of advertising companies, which use them to collect information and track visitor behaviour and activity in order to display relevant ads and offers.
When a web page downloads and loads resources from external sites, while the browser is loading that page, it makes separate requests to those external sites in the background.