function getCookie (cookieName) {
  return document.cookie.match('(^|;)\\s*' + cookieName + '\\s*=\\s*([^;]+)')?.pop() || undefined;
}
Gets a cookie given its name and returns undefined if it can't be found
@param {String} cookieName - The name of the cookie to retrieve
@returns {String} cookie - The value of the cookie or undefined if it can't be found