Marshy Posted November 28, 2007 Report Share Posted November 28, 2007 Hi All,I am having some major problems using cookies. Whilst developing the site on localhost I had no problems.I have configured my firewall to forward http traffic from a public IP to my machine and cookies just will not work.I have created a simple test page which consist of this: <?php $value = 'something from somewhere'; setcookie("TestCookie", $value, time() + 3600); // Print an individual cookie echo $_COOKIE["TestCookie"] . "<br>"; echo $HTTP_COOKIE_VARS["TestCookie"] . "<br>"; // Another way to debug/test is to view all cookies echo "<pre>"; print_r($_COOKIE); echo "</pre>"; ?> But no cookie is created.Can anybody tell me why? Is it related to my firewall? Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted November 28, 2007 Report Share Posted November 28, 2007 IE somethings block junk cookies too so it might be that... Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
Marshy Posted November 29, 2007 Author Report Share Posted November 29, 2007 Nah its not that. It's doing this in Firefox as well.I have been monitoring the HTTP headers sent to/from the server and I can see the request to create a cookie and the client is sending it back in the header.I have just noticed however that there is something funny in $_SERVER.When accessed through localhost it looks like this ["HTTP_COOKIE"]=> string(15) "test=test+value"When accessed from the Internet i get this ["HTTP_XOOKIE"]=> string(15) "test=test+value" What is XOOKIE and why is the data sent there? Quote Link to comment Share on other sites More sharing options...
Marshy Posted November 29, 2007 Author Report Share Posted November 29, 2007 I have solved the problem.Our firewall uses something called Protection Profiles (its a FortiGate) that was deforming the cookie part of the packet.I removed the option to block cookies and everything is A-OK. Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted November 30, 2007 Report Share Posted November 30, 2007 lol, that was my next troubleshooting idea. Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
Marshy Posted November 30, 2007 Author Report Share Posted November 30, 2007 Great minds think alike Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted December 3, 2007 Report Share Posted December 3, 2007 lol Quote Best Regards Olajide Olaolorun The Uniform Server Development Team 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.