tags:

views:

33

answers:

1

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?

+2  A: 

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');
Greg