OK, one more question. You set the IP address for the cookie. When the script is called again, is it on the IP address, or on a domain name that is on that IP address?
If the latter, then change the IP to the domain name when setting the cookie and see if that works.