如何在PHP中设置Cookie

时间:2018-11-29 19:52:15

标签: php cookies

嗨,我正在按照W3schools的示例在PHP中设置cookie,这表明未设置cookie。有什么办法吗?全部

<?php
if(!'isset'($_COOKIE[$cookie_name])) {
    echo "Cookie named '" . $cookie_name . "' is not set!";
} else {
    echo "Cookie '" . $cookie_name . "' is set!";
    echo "Value is: " . $_COOKIE[$cookie_name];
}
?>

0 个答案:

没有答案