PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_Request » Bug #1080

Cookies UrlEncoded

Details

Submitted2004-03-26 21:49 UTC
Fromeric_c_72 at yahoo dot com
Assignedavb
StatusClosed
PackageHTTP_Request
PHP Version4.3.3
OSFedora
Roadmaps(Not assigned)

Comments

[2004-03-26 21:49 UTC] eric_c_72 at yahoo dot com

Description:
------------
I had problem with an email address in a cookie where it was urlencoded.

I was using a php script to request pages from a web server and when I passed my email address in a cookie to the web server it would recieve %40 instead of the @. I turned logging on for cookies on the web server and a browser sends the @ but my script sent a %40.

Reproduce code:
---------------
function addCookie($name, $value)
{
$cookies = isset($this->_requestHeaders['Cookie']) ? $this->_requestHeaders['Cookie']. '; ' : '';
# $this->addHeader('Cookie', $cookies . urlencode($name) . '=' . urlencode($value));
$this->addHeader('Cookie', $cookies . $name . '=' . $value);
}

Expected result:
----------------
The code above fixed the problem.

Actual result:
--------------
sent %40 instaed of @