Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.1

Bug #20561 CookieJar compares request host w/ response cookie domain, fails after redirect
Submitted: 2015-06-12 02:37 UTC
From: ncklaus Assigned: avb
Status: Closed Package: HTTP_Request2 (version Unknown)
PHP Version: 5.4.40 OS:
Roadmaps: (Not assigned)    

 [2015-06-12 02:37 UTC] ncklaus (Klaus Netcreators)
Description: ------------ When I request URLs on or, I get Exceptions like "Domain cannot set cookies for" and "Domain cannot set cookies for" thrown. In \HTTP_Request2_CookieJar::checkAndUpdateFields --> \HTTP_Request2_CookieJar::domainMatch, the host of the original request (e.g. is compared to the cookie domain In e.g. Firebug you can see that the request for is replied to with a HTTP 302 and Location: Only the response to the then following request to contains a Set-Cookie. The CookieJar should therefore compare the Set-Cookie domain with the host of the last redirect target.


 [2015-06-30 21:14 UTC] avb (Alexey Borzov)
-Status: Open +Status: Closed -Assigned To: +Assigned To: avb
For the record: the bug was only present in Curl adapter. Fixed in Git: CookieJar::addCookiesFromResponse() now uses effective response URL if $setter is not explicitly given, this will prevent further problems with passing incorrect URLs.