read remote site and keep in array the vars to the cookie

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
User avatar
visonardo
Forum Contributor
Posts: 136
Joined: Mon Oct 02, 2006 7:49 pm
Location: Argentina, South America´s Sun.

read remote site and keep in array the vars to the cookie

Post by visonardo »

i want know how i wuould keep in an array the cookies´s vars that i receive the a remote content page header that i read. suposedly that i have the complete code of remote page, with headers and allo, how i should do to take the vars that it send to do the cookie or best said that the cookie would keep if is created?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Wow, it's a bit difficult to decipher what you're saying.

From what I can tell, you wish to store, in some fashion, the cookies set by a remote page that your server is requesting. The solution to this depends on how you want to save them and how you want to use them. If the intention is to continue using them with this remote site, then cURL can do this for you. If you yourself want to read them, you may need to parse out the cookies for yourself. To parse them, you will have to break off the header from a page request and analyze the lines for "Set-Cookie" directives.
User avatar
visonardo
Forum Contributor
Posts: 136
Joined: Mon Oct 02, 2006 7:49 pm
Location: Argentina, South America´s Sun.

Post by visonardo »

Thank feyd.

Im doing a case of proxy. To that work rightly, when the user long-in in a page, my script receive a set cookie header as feyd told, here i should keep this vars in an array, and my own script do a cookie in the user with an array that say (for example)

$array_kept_in_userpc[$remotehost]=serialize($arrayvarskeptfromremoteserver);

then, when the user move inner this site by each movement i will take my cookie i create before and see if exist some vars kept there to the site where user want go. Understand what i want to do?
Post Reply