Page 1 of 1

export cookies

Posted: Wed Jul 17, 2002 4:27 pm
by Dani
Hello!
I have a problem. I don“t know if htere are in php a function as getcookie (in perl). Anybody known it?? I need is know because I need to receive a cookie from other server that it is diferent that mine. (My server change to be a client in a moment). HELP!!
PD: Pardon for my english. Thanks.
Dani

Posted: Wed Jul 17, 2002 4:54 pm
by protokol
Well, to set a cookie, you would use the setcookie() function. To retrieve a cookie you would use the $_COOKIE array.

This code shows what the $_COOKIE array is comprised of (if anything)

Code: Select all

<?php
foreach ($_COOKIE as $cookie=>$value)
   echo "$cookie = $value<br />";
?>
Not sure how to get a cookie set by a different server though.

Posted: Wed Jul 17, 2002 6:56 pm
by sam
There is no function to get a cookie originating from another host than yours... You my try to use the socket functions to do so but I'm not sure that they will help you as you have requested (I couldn't really tell what you wanted anyway). :(

Cheers Sam