Re: fsockopen & cookies
| From: | Ben Peter | Date: | Tue, 13 Jun 2000 20:59:27 +0000 |
| Subject: | Re: fsockopen & cookies | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1757@lists.php.net to get a copy of this message | ||
moshe,
it's all up to the client to send the cookie when it sees that a request
goes to a URL it has a cookie for. Say, server www.foo.bar has set you a
cookie 'cook=100', it is up to you to store that cookie somewhere and send
it along next time you send a request to that server.
This would include expiration checks and URL checks (to which servers will
a cookie be sent, will it be sent on any request to a server or does it
only belong to a specific subdirectory, etc...)
Ben
On Tue, 13 Jun 2000, moshe wrote:
> i use the fsockopen (no the fopen for some resons) to get http file
> for exem:
>
> $errno = $errstr = 0;
> $fp = fsockopen("www.php.net", 80, &$errno, &$errstr, 30);
> if(!$fp) {
> echo "$errstr ($errno)<br>\n";
> } else {
> fputs($fp,"GET / HTTP/1.0\n\n");
> while ($line = fgets($fp,4096)){$string.=$line;}
> fclose($fp);
> echo $string;
> }
>
> when the server send me cookies i get in the header:
> somthing look like:
>
> HTTP/1.1 200 OK
> Server: Microsoft-IIS/4.0
> Date: Tue, 13 Jun 2000 20:31:36 GMT
> Set-Cookie: ssuid=1l1PM0000ec00047ekqqa49162; path= /;
> expires=Saturday, 06-Sep-2014 23:50:08 GMT
> Content-Type: text/html
>
> how can i know if the server ask me for the cookies ? (meen the server
> use get_cookies or somthig else).
> does the server ask it in the header?
>
> thnks moshe.
>
>
>
--
Benjamin Peter
Zentropy Partners GmbH
ph. +49-69-96244-395
pax +49-69-96244-244
http://www.zentropypartners.com
"Integrate the building and marketing of digital businesses"