TonyB Posted May 13, 2007 Share Posted May 13, 2007 Cookies don't work on IE6, but work fine (same client PC) under Firefox. Using Apache2.2 and PHP5. I have a network of 7 PC's behind my Router. One I use to develop and test, one for live. Problem occurs on all clients (various specs) under IE, works fine under Firefox. Basically cookies work fine (under IE) when I test locally, but don't get created when server is on one PC and client is another. Sessions suffer the same problem. I push the cookie using setcookie('Please_work','a_value'); I dump cookies using print_r($_COOKIE); I refresh, I get cookie if localhost, empty array if different client / host. I suspect it's something to do with domains. ??? I call server 'ww_dell' (from client IE6 http://ww_dell/ pulls up pages fine). Server httpd.conf has ServerName ww_dell:80 I've tried commenting this out, this made no difference. I've added HostNameLookups On basically so I can identify the client within PHP (my Router does DHCP, so IP addresses are dynamic). Within PHP.ini I haven't changed anything, so it contains: session.cookie_path = / session.cookie_domain = Is there a way to find what domain the setcookie command defaults to? Or what domain the client 'thinks it is'. I know if the two don't match cookies are not going to work. Any help /suggestions appreciated; I have been bashing my head against this one for a couple of weeks now and it's driving me nuts! Cheers, Tony Quote Link to comment Share on other sites More sharing options...
marmite Posted May 13, 2007 Share Posted May 13, 2007 I know nothing about cookies, except to suggest echo'ing $_COOKIE['something'] But my main reason for replying is to ~bump~ this as it has not had a reply. Someone must know! Quote Link to comment Share on other sites More sharing options...
gingerboy101 Posted July 12, 2007 Share Posted July 12, 2007 Hi Mate, Sorry just sore this and thought that I would reply, there is yet another handler in the PHP.ini file: #Weather to use cookies session.use_cookies = 1 Is this set to one (yes)? Cheers Quote Link to comment Share on other sites More sharing options...
per1os Posted July 12, 2007 Share Posted July 12, 2007 www.php.net/setcookie The way you called setcookie with only a name/value will work for localhost. But for production servers you need it to have varname, value, timetoexpire, path, domain Thats your problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.