读:
比如你需要读name为cookiename的cookie
var cookies = document.cookie;
var start = cookies.indexOf("cookiename=");
if (start == -1) {
   alert("cookie not found");
}
start = cookies.indexOf("=", start) + 1;
var end = cookies.indexOf(";", start);
if (end == -1) {
   end = cookies.length;
}
var value = unescape(cookies.substring(start, end));
if (value == null) {
   alert("cookie not found");
} else {
   alert("cookie value is:" + value);
}