CGIC can be written in cookie, but Javascript why can't read it.

CGIC can be written in cookie, but Javascript why can't read it? Use the IECookiesView to read and can read and write cookie, but not JavaScript
function GetCookie(name)
{
var result = null;
var myCookie = document.cookie + ';';
var searchName = name + '=';
var startOfCookie = myCookie.indexOf(searchName);
var endOfCookie;

if (startOfCookie != -1)
{
startOfCookie += searchName.length;
endOfCookie = myCookie.indexOf(';',startOfCookie);
result = unescape(myCookie.substring(startOfCookie, endOfCookie));
}
}

document.form1.cvalue.value = GetCookie("qwe");
Seek help

Started by Tamara at November 12, 2016 - 7:48 AM

UP

Posted by Bill at November 24, 2016 - 8:36 AM

GetCookie this function, you forgot to write the return value.

return result; You can.

Posted by Edison at December 04, 2016 - 9:09 AM

Have a look inside the CGIC write cookies path is it right? "/" the other path, JS does not recognize

Posted by Stanley at December 06, 2016 - 9:49 AM