1

I'm trying to pull out the value of a cookie from the response of an external request in Kohana 3.2

$response = Request::factory('http://myurl')->execute();
echo $response->cookie('cookie');

Now in my example above, the server response from 'http://myurl' is setting the cookie cookie. In fact, if I do print_r($response->headers()); I can see the cookie being set in the set-cookie header.

But yet when I just try to access the cookie from $response->cookie('cookie'); I don't get anything.

Is there something I'm doing wrong?

krische
  • 1,010
  • 3
  • 11
  • 17
  • What outputs when you run the following echo Debug::vars($response->cookie()); exit; – Mike Aug 30 '12 at 10:42

1 Answers1

2

I had exactly the same problem - I solved it using $response->headers('Cookie')

matino
  • 17,199
  • 8
  • 49
  • 58