Home » HTTP » HTTP_Request » Bug #1080
Cookies UrlEncoded
Details
| Submitted | 2004-03-26 21:49 UTC |
|---|---|
| From | eric_c_72 at yahoo dot com |
| Assigned | avb |
| Status | Closed |
| Package | HTTP_Request |
| PHP Version | 4.3.3 |
| OS | Fedora |
| 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 @