How to receive HTTP cookies from a web server in PHP?
A:
Just use the $_COOKIES superglobal
Well, and then send them back to the server... I want to login in this way
This suggests you want to know how to send them to the browser in the browser place.
See setcookie.
David Dorward
2009-08-01 20:16:35
Next time try to elaborate more. If he doesn't know the $_COOKIES superglobal then he's new to php.
the_drow
2009-08-01 20:34:02
A fast answer to a fast question seems fair to me.
toto
2009-08-01 20:57:24
That's why I made $_COOKIES ... a link!
David Dorward
2009-08-02 06:39:10
+1
A:
Check the HTTPRequest class and take a look at the getCookies and setCookies functions. You can also use the $_COOKIES but it's much more low level.
the_drow
2009-08-01 20:21:28
+1
A:
I'm assuming that you want to interact with cookies from a remote webserver using PHP, rather than simply manipulating cookies from a client browser.
In that case, take a look at the Zend_Http and related classes in the Zend Framework. These let you perform HTTP requests with cookie persistence and a whole lot more besides.
Paul Dixon
2009-08-01 20:21:46