code: function getCookie(name){
          var mapCookies = {};
          var cookie = document.cookie || '';
          cookie.replace(/([^=]+)\s*=\s*([^;]*)\s*;?\s*/g, function(all, name, value){
              mapCookies[name] = value;
          });
          return mapCookies[name];
      }
docs: 读取cookie