Home > Article > Backend Development > Do you know something to note about the use of Php Cookies?
One thing that needs to be noted here is that in php, if you set COOKIE on the current page, before the current page is refreshed or redirected to other pages, the cookie The setting result will not take effect (if the cookie has not expired).
The code is as follows:
<?php setcookie('test', 'this is a cookie test'); echo ($_COOKIE['test']); ?>
The above code will not display the results you want
The above is the detailed content of Do you know something to note about the use of Php Cookies?. For more information, please follow other related articles on the PHP Chinese website!