You will find that after this statement is executed, there is nothing in the Cookie, and the next page will show that there is no COOKIE variable value of $USERID. The problem analysis is as follows: First,"/> You will find that after this statement is executed, there is nothing in the Cookie, and the next page will show that there is no COOKIE variable value of $USERID. The problem analysis is as follows: First,">
Home > Article > Backend Development > Cookie settings PHP COOKIE is set to the browser process
For example:
Copy code The code is as follows:
$USERID="PHPer";
$CookieTime=0;
setcookie("USERID", "$USERID", time()+ $CookieTime,"/","btcuxiao.com");
?>
Copy code The code is as follows:
$USERID="PHPer";
$CookieTime=0;
setcookie("USERID", "$USERID", 0 ,"/","");
echo (isset($_COOKIE['USERID']) ? $_COOKIE['USERID'] : '');
?>
The above introduces the cookie settings. PHP COOKIE is set as a browser process, including cookie settings. I hope it will be helpful to friends who are interested in PHP tutorials.