Okay, Im having some problem using setcookie().  Basically, I have to form fields, 
Username/Login.  When the username and login are authenticated using mysql, it logs 
into the secure area.  I set the cookie so taht it takes the $username variable that 
the user entered into the form and on the page the user gets after he logs in I want 
it to display:

Welcome $Domainname.  But it's not working.  The cookie is not being set.

I am using this code on the login page.


setcookie("DomainName", $Domainname, 0, "/", ".mydomain.com", 0);


.mydomain.com isn't the actual domain, I put my own domain there.

$domainname is the form field name.

I then use on the second page.

$dname = $HTTP_COOKIE_VARS["DomainName"];

Then on the page

echo "Welcome $dname";

Still doesn't work.  Any help is greatly appreciated.


Reply via email to