0 && $expiration <= 60*60*24*30) { $expiration += time(); } # 设置 $_COOKIE 变量,否则当前进程写完cookie后是无法立即读取到的。 $_COOKIE[$key] = $value; return setcookie($key, $value, $expiration, $cookie_path, $cookie_domain, $secure, $httponly); } }