I'm trying to with Cookies and Zend Framework 1.10. This is my code:
$zendCookie = new Zend_Http_Cookie('foo', 'bar', 'localhost', time() + 60 * 60 * 24 * 30);
$client = new Zend_Http_Client();
$client->setCookie($zendCookie);
But the cookies aren't stored. I checked it with Firecookie Firefox's extension. What's wrong?
Localhost does some weird stuff with cookies.
I would setup a vhost with a psuedo server name and make this an entry in your hosts file and point it to
127.0.0.1IE:
Then in your /etc/hosts (or C:\Windows\System32\drivers\etc\hosts) You would add:
Then you can access the application locally by calling test.dev and you would use that in place of "localhost" for the cookies and it should not mess with the cookies like localhost does. You can find a bit more information on what I am talking about with the localhost cookies here.