ZF-6675: Automatic cookie concatenation (urlencoding) problem

Issue Type: Bug Created: 2009-05-15T07:36:27.000+0000 Last Updated: 2011-07-28T20:51:15.000+0000 Status: Open Fix version(s): Reporter: Inash Zubair (inash) Assignee: Shahar Evron (shahar) Tags: - Zend_Http_Client

  • Zend_Http_Cookie
  • Zend_Http_CookieJar

Related issues: Attachments:


when sending cookies or setting the cookie jar along with existing cookies, while making a request through the http client, by default, url encodes the cookie value. this is done while returning all the cookies in the cookie jar when finally calling the cookie::__toString() method.

some applications including proprietary web applications, accept and compare cookies as it is set and sent back to the server (raw). so while making requests with the http client, the cookie header values being url encoded raises an issue here, simply because a raw value and a urlencoded value will not match. this happens when the cookie value contains literal characters such as *#$%<>, etc.

there could be 4 possibilities to fix this issue.

  1. to disable url encoding altogether when concat returning the cookie using __toString().
  2. by allowing an additional optional parameter to be set while setting the cookiejar with the http client that acts as a flag, to disable url encoding.
  3. by allowing an additional optional parameter while making the request().
  4. by setting a http client config parameter. eg: disablecookieurlencoding.


Posted by David Goodwin (davidgoodwin) on 2011-07-28T19:18:18.000+0000

Zend_Http_Client has a configuration parameter for 'encodecookies' - if set to false, then no encoding is done. The encodecookies value is passed into Zend_Http_Cookie::fromString("key=value", $uri, $encodecookies) when Zend_Http_Client's setCookie() is called.

(To me this implies there is a solution for this ticket, and it can be closed?)

Posted by Inash Zubair (inash) on 2011-07-28T20:51:15.000+0000

Shall test and revert.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.