Syed-What SBP is saying is that you did not declare a cookie with the value of $user in your example.
<?
$ex = time() + 3600;
setcookie("username",$user,$ex);
?>
Okay, so you make the variable $user have the value of data that is posted.
What if no data is posted?
And on top of that, if $user is just a variable, it will not SAVE the username, or validate if a user is logged in.
That's still kind of fuzzy...You're making it sound like $user or $name is simply the NAME of the session/cookie--not the value.
Meh. Whatever.
The picture as a whole is clear though, and this thread has been resolved.