function getCookie(name) {
  const v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
  return v ? v[2] : null;
}
@param {string} name The cookie name.
@return {?string} The corresponding cookie value to lookup.