PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Request » Bug #4505

Should remember cookies between redirects

Details

Request #4505Should remember cookies between redirects
Submitted2005-06-02 03:41 UTC
Fromarailean at squiz dot net
StatusWont fix
PackageHTTP_Request
PHP Version4.3.11
Roadmaps(Not assigned)

Comments

[2005-06-02 03:41 UTC] arailean at squiz dot net

Description:
------------
It would be very good if HTTP_Request properly managed the cookies between redirects if they are allowed. Currenly if redirects are allowed, any intermediate cookies are ignored until the destination is reached (i.e. the non-redirecting response). For the systems where the request-response flow depends of those cookies, the result will be undesirable because either the cookie set in the final HTTP_Response will not be complete, or might affect the final redirect location and response.

I know HTTP_Client has the ability to handle these situations, but for consistency so should HTTP_Request if it claims to handle redirects. For some applications using HTTP_Client may not be convenient.

Introducing a Cookie manager into the HTTP_Request shouldn't introduce much overhead in terms of memory or speed.

I see that bug #2254 touches this topic, but decided to give it another try.

Supplying a diff with canges.

Reproduce code:
---------------
48a49
> require_once 'HTTP/Client/CookieManager.php';
201a203,208
> * Instance of HTTP_Client_CookieManager
> * @var object HTTP_Client_CookieManager
> */
> var $_cookieManager;
>
> /**
228a236
> $this->_cookieManager = &new HTTP_Client_CookieManager();;
616c624,627
<
---
> // Remember cookies between redirects
> $this->_cookieManager->updateCookies($this);
> $this->_cookieManager->passCookies($this);
>

[2005-10-20 16:46 UTC] seth at pricepages dot org

You should really mention somewhere that redirects are
depreciated. I was just about to submit a patch for some
added functionality, now I need to rewrite it for
HTTP_Client.