|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
40 + 14 = ?
Subscribe to this entry?

 [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: Fri May 24 20:01:29 2024 UTC