Re: a cookie handling patch for HTTP_Request
| From: | Martin Jansen | Date: | Wed, 18 Sep 2002 09:07:26 +0000 |
| Subject: | Re: a cookie handling patch for HTTP_Request | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-9149@lists.php.net to get a copy of this message | ||
On Wed Sep 11, 2002 at 03:3351PM +0400, Alexey Borzov wrote:
> I tried to use HTTP_Request/HTTP_Response classes in my project and
> found out that they did not work quite well with cookies set in server's
> response. HTTP_Response kept all response headers in associative array
> (header name => header value). As the response can contain _multiple_
> Set-Cookie headers, their values got overwritten. Besides, there
> was no easy way to add cookies to request or to extract their
> values from response.
>
> This patch adds two methods: addCookie() and getResponseCookies()
> to HTTP_Request class and Set-Cookie parsing logic to
> HTTP_Response's constructor. Cookies are kept (and returned via
> getResponseCookies()) in an array with numerical keys (as multiple
> cookies can have the same name).
The patch looks fine for me. What do the maintainers think?
--
- Martin Martin Jansen
http://martinjansen.com/