export cookies

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Dani
Forum Newbie
Posts: 1
Joined: Wed Jul 17, 2002 4:27 pm
Location: Madrid (spain)

export cookies

Post 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
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post 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.
Last edited by protokol on Wed Jul 17, 2002 7:09 pm, edited 1 time in total.
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post 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
Post Reply