Cookies Overview

Cookies Overview

Browser Cookies

  • A plain text file that is 4Kb or smaller
  • Contains name-value pairs associated with a visit to a web site
  • Sent as an HTTP header from a web server to a web browser
  • Sent back to the web server from the browser each time the browser requests pages from that server
  • Almost all websites use cookies to store information in peoples' web browsers
  • Some websites contain hundreds of cookies

Types of Browser Cookies

  • First-party Cookies
    • Cookies created by the web site that was directly visited by the user
    • Contents can only be retrieved by the web site domain that created the cookie
  • Third-party Cookies
    • Cookies created by a web domain not directly requested by the visitor
    • Contents can be retrieved by other web domains listed when the cookie is written

Standard Uses for Browser Cookies

  • Login information is stored in a cookie so users can leave and re-enter a website without needing to type their username and password again
  • Session cookies can act as a “bookmark” so users don't have to remember where they left off on the site's pages
  • Session cookies can store ordering information required for shopping carts to work
  • Persistent cookies can store user preferences. such as customized site layouts, language selection, theme selection, menu preferences, internal site bookmarks or favorites,

The Cookie Law

  • Legislation that requires websites to get consent from visitors to store or retrieve any information on a computer, smartphone or tablet
  • Designed to protect online privacy, by making consumers aware of how information about them is collected and used online, and give them a choice to allow it or not
  • Started out as an EU Directive that was adopted by all EU countries in May 2011
  • All websites owned in the EU or targeted towards EU citizens are expected to comply with the law

Sitecore Cookies

  • Sitecore CMS user authentication depends on client cookies
    • Engagement Analytics session cookie
    • Used to identify a sequence of HTTP requests from a single user
    • Expires when the user closes the Web client
    • Persistent session cookie used to identify repeat visits from a single user
    • Expires one year after the last page requested by the web client

Sitecore Analytics Cookie Consent

  • A GitHub project that enables developers to control the creation of the cookies used by Sitecore Analytics in order to comply with the EU cookie law
  • The tracking session and its cookies will only be created when a specific cookie with a specific value exists
  • Available at