|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60482 Add cookies to stream_context
Submitted: 2011-12-09 14:48 UTC Modified: 2012-12-23 17:44 UTC
From: jille at hexon dot cx Assigned:
Status: Not a bug Package: Streams related
PHP Version: Irrelevant OS: n/a
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jille at hexon dot cx
New email:
PHP Version: OS:


 [2011-12-09 14:48 UTC] jille at hexon dot cx
I think cookies would be a usable addition to the possibilities of stream-context's.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-11 16:18 UTC]
It is trivial to add cookies by adding Cookie: headers.
 [2012-12-23 17:44 UTC]
-Status: Open +Status: Not a bug
 [2012-12-23 17:44 UTC]
This can already be achieved using existing (albeit pretty low-level) 
functionality of the streams API:

$opts = array(
  "http" => array(
    "method" => "GET",
    "header" => "Cookie: foo=bar",

$context = stream_context_create($opts);

$result = file_get_contents('', false, $context);
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 07:01:29 2024 UTC