3 thoughts come to mind...
1) You are not on a secure link when accessing the cookie. (The "1" at the end of the setcookie is only transmitted over a secure HTTPS connection)
2) $row[0] is an empty string, make sure this variable is being set correctly.
3) PHP is not automatically populating cookie variables (what version of PHP are you using?)... Try using this instead:
echo $HTTP_COOKIE_VARS[username];
In fact, using this sort of convention is generally accepted as good coding practice. (Using the globals array to access variables in cookies, and get/post variables).
Hope this helps!
John Cornett
Senior Development Engineer
Web Teks, Inc.
http://www.web-teks.com