I'm new PHP guy and I'm using PHP cookie and I'm facing a problem that the cookie can not be set correctly. Here is the statement of Set Cookie
setcookie('cookieusername', $username, 100000);
and the statement of Get Cookie
$cookieusername = $_COOKIE["cookieusername"];
The problem is, the value of $_COOKIE["cookieusername"];
is not defined.
I don't know what the problem is. I have tired to set the cookie path to '/' but which was still not work.