function Cookie2Json(cookie) {
var result = "";
cookie = cookie + ";"
var cookis = cookie.split(";");
for (var i = 0; i < cookis.length - 1; i++) {
if (cookie[i].split("=").length > 0) {
result = result + ",\"" + cookis[i].split("=")[0].trim() + "\":\"" + cookis[i].split("=")[1] + "\"";
}
}
cookie = JSON.parse("{" + result.substr(1).replace("\\", "") + "}");
result = cookie;
return result;
}