【发布时间】:2015-09-29 17:01:56
【问题描述】:
<?php
$product1 = "user";
if(!isset($_COOKIE[$cookie_name])) {
$value=1;
echo "Cookie named '" . $product1 . "' is not set!";
setcookie($product1, $value, time() + (86400 * 30), "/");
} else {
echo "Cookie '" . $product1 . "' is set!<br>";
echo "Value is: " . $_COOKIE[$product1];
$value=$_COOKIE[$product1];
setcookie($product1, $value, time() + (86400 * 30), "/");
}
?>
// 刷新页面后,我不断收到名为 user is not set 的消息 cookie。请帮忙
【问题讨论】:
-
我在 if 语句中将 $cookie_name 更改为 $product
标签: php