Home > Backend Development > PHP Tutorial > 关于cookie在代码中执行的顺序有关问题

关于cookie在代码中执行的顺序有关问题

WBOY
Release: 2016-06-13 12:38:56
Original
1202 people have browsed it

关于cookie在代码中执行的顺序问题?
setcookie("user","Dean",time()+100);
echo $_COOKIE['user'];
?>
为什么上面代码第一次执行的时候报user未定义错误,而第二次执行则能够取出user数据,什么情况,是不是cookie在程序中最后执行啊,但php语句块不是按从上到下顺序执行的吗?

php cookie 执行顺序
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template