Req #60482 [Opn->Nab]: Add cookies to stream_context
| From: | mj@php.net | Date: | Sun, 23 Dec 2012 17:44:42 +0000 |
| Subject: | Req #60482 [Opn->Nab]: Add cookies to stream_context | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-175564@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60482&edit=1
ID: 60482
Updated by: mj@php.net
Reported by: jille at hexon dot cx
Summary: Add cookies to stream_context
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: Streams related
Operating System: n/a
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
This can already be achieved using existing (albeit pretty low-level)
functionality of the streams API:
<?php
$opts = array(
"http" => array(
"method" => "GET",
"header" => "Cookie: foo=bar",
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://example.com/server.php', false,
$context);
?>
Previous Comments:
------------------------------------------------------------------------
[2011-12-11 16:18:27] cataphract@php.net
It is trivial to add cookies by adding Cookie: headers.
------------------------------------------------------------------------
[2011-12-09 14:48:07] jille at hexon dot cx
Description:
------------
I think cookies would be a usable addition to the possibilities of stream-context's.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60482&edit=1