javascript - Why document.cookie is not working -
var curcookie = name + "=" + value + "; expires=" + ats_getexpire() + "; path=" + path + "; domain=" + domain ; document.cookie = curcookie; alert("your cookie : " + document.cookie);
when use above code alert message coming empty. why document.cookie coming empty. please answer.
see here live example
you're using ;
instead of ,
.
use ,
deliminate cookie values
var curcookie = name + "=" + value + ", expires=" + ats_getexpire() + ", path=" + path + ", domain=" + domain; document.cookie = curcookie; alert("your cookie : " + document.cookie);
Comments
Post a Comment