fsockopen & cookies
| From: | moshe | Date: | Tue, 13 Jun 2000 21:55:06 +0000 |
| Subject: | fsockopen & cookies | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-1755@lists.php.net to get a copy of this message | ||
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.