Reputation: 25274
This is the command with which I set cookies:
setcookie('username', $username, strtotime('+1 months'), '/', '.localdomain.com/jp/');
This is the statement with which cookie is read:
$user=$_COOKIE['username'];
Why can I not read cookies on another page?
Upvotes: 0
Views: 105
Reputation: 321578
Your setcookie()
call is wrong - you can't have a path in the domain part - it should be:
setcookie('username', $username, strtotime('+1 months'), '/jp/', '.localdomain.com');
Upvotes: 2