From:             tom916 at qq dot com
Operating system: linux
PHP version:      5.3Git-2012-12-22 (Git)
Package:          *General Issues
Bug Type:         Bug
Bug description:two cookie in request ,get comma in first cookie name

Description:
------------
When the browser client send 2 Cookie: in header,the php get first cookie
name has a comma in the fist char。God know know the browser send 2 Cookie
in header ?


Array
(
    [,_a] => 1
)

Test script:
---------------
------------------show_cookie.php--------------
<?php
print_r($_COOKIE);

------------------send_cookie.php--------------
<?php
$fp = fsockopen("localhost", 50080, $errno, $errstr, 30); //my apache
listen on 50080
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "GET /show_cookie.php HTTP/1.1\r\n";
    $out .= "Host: localhost:50080\r\n";
    $out .= "Cookie:\r\n";
    $out .= "Cookie: a=1\r\n";
    $out .= "Connection: Close\r\n\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {
        echo fgets($fp, 128);
    }
    fclose($fp);
}


php send_cookie.php

---------result-----------
HTTP/1.1 200 OK
Date: Sat, 22 Dec 2012 17:11:59 GMT
Server: Apache/2.2.17 (Unix) PHP/5.3.3
X-Powered-By: PHP/5.3.3
Content-Length: 25
Connection: close
Content-Type: text/html

Array
(
    [,_a] => 1
)


Expected result:
----------------
Array
(
    [a] => 1
)

Actual result:
--------------
Array
(
    [,_a] => 1
)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63835&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63835&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63835&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63835&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63835&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63835&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63835&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63835&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63835&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63835&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63835&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63835&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63835&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63835&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63835&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63835&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63835&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63835&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63835&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63835&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63835&r=mysqlcfg

Reply via email to