Page 1 of 1
read remote site and keep in array the vars to the cookie
Posted: Tue Oct 31, 2006 8:07 am
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?
Posted: Tue Oct 31, 2006 9:08 am
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.
Posted: Wed Nov 01, 2006 6:25 pm
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?