On my server when using the code:
<?php
$expire=time()+60*60*24*360;
$cookie_name = 'user';
$cookie_value = "John";
setcookie($cookie_name, $cookie_value, $expire, "/");
$cookie_value = "Jane";
setcookie('userb', $cookie_value, $expire, "/");
print_r($_COOKIE);
?>
The first cookie does not set, but the second one does. For some reason it appears that using a variable to identify the cookie name causes it not to set. This problem does NOT occur on my localhost (everything works as expected). So I'm not even really sure where to begin.