$cookie_name = 'dee[user]'; i wanted to put in a array , isit here causing the problem?
$cookie_value = 'dee[authID]';
setcookie($cookie_name, $subname, time() + (86400 * 30), '/','127.0.0.1', false);
setcookie($cookie_value, $authID, time() + (86400 * 30), '/','127.0.0.1', false);
if(!isset($_COOKIE[$cookie_name])){
print 'Cookie with name "' . $cookie_name . '" does not exist...';
}else{
print 'Cookie with name "' . $cookie_name . '" value is: ' . $_COOKIE[$cookie_name];
}
为什么我的饼干未设置?它不断返回虚假。我试图将cookie数组设置为localhost。
$ subname和$ authID,工作正常,只需将其视为一个值。