Help, I'm in Cookie hell !!!
Posted: Wed Mar 01, 2006 2:15 pm
I have scripts setting and reading cookies. Everything works great on my server (Apache2, PHP4.4.0-3), but on my customer's server (Apache1.3.34 PHP4.4.1) the scripts can set the cookies fine, but can't read them. And, yes I know, I've learned my lesson - develop in a server with the same specs and config as the final server. In the mean time does anyone know what might be wrong? I'm using the code below to set and read the cookies...
Set cookie:
Read cookie: (not working)
As per php.net's recommendation, I did a print_r($_COOKIE), and it doesn't show the cookie. The cookie is there though, because I can see it with Edit>Preferences>Privacy>View Cookies on my browser (Firefox). Thanks in advance for any help. Also, just a note, it's not a browser setting, because everything works great on my server with the same browser.
Set cookie:
Code: Select all
setcookie("cust", $id, time()+60*60*2, '/');Code: Select all
$cust = $_COOKIE["cust"];