我正在尝试读取名为 Pdf 的 cookie,它具有以下值
http://engine.edocbuilder.com/include/fileDownload-aspx?p=xBfpz3UGPkWamLTDILo%2fWbFqh3FomdYuByiTwfB4RXN0sDN6tY%2fDfxJzzfPZblUl5aSBO3v96%2bJ6acwT7L5oi8tyMuGwKshYtGK%2bfhgiSfM%3d&s=4995b496-e735-4a26-9801-253a34ab0481
但是当我读到这个 cookie 时,我得到了以下格式的值,你能告诉我解决方案吗?
s=a4823a90%2D80e6%2D4006%2D909c%2D69d567f2d318&http%3A%2F%2Fengine%2Eedocbuilder%2Ecom%2Finclude%2FfileDownload%2Easpx%3Fp=%2BRj53ETGUI%2FeK7H8yo2Zj%2F6z9Ggmk4VEgmPEtoA2NPDhomzjaYvk2wkh0OZzWt8OtDcATY%2BknqGG8AuxddA6LWccWAfbQgtI0dlVkWevheg%3D
以下是读取cookie的代码:
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name)
{
return unescape(y);
}
}