I have a directory, under it there are two php files index.php
, index2.php
:
in the index.php
:
<?php
$_COOKIE['constant_a']='A';
echo($_COOKIE['constant_a']);
in the index2.php
:
<?php
echo($_COOKIE['constant_a']);
Firstly, I access the http://localhost:63342/htdocs/index.php
, the browser will show the A
.
but then I input the index2.php
, http://localhost:63342/htdocs/index2.php
:
there print Undefined Error:
Notice: Undefined index: constant_a in /Users/sof/Desktop/htdocs/index.php on line 12
Why it do not shows the A
?