cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[ curl-Bugs-3513010 ] Follow Location: CURLOPT_COOKIE vs CURLOPT_HTTPHEADER

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 29 Mar 2012 16:28:18 -0700

Bugs item #3513010, was opened at 2012-03-29 16:28
Message generated for change (Tracker Item Submitted) made by buccinator
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3513010&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: swan (buccinator)
Assigned to: Nobody/Anonymous (nobody)
Summary: Follow Location: CURLOPT_COOKIE vs CURLOPT_HTTPHEADER

Initial Comment:
Hello, im using PHP 5.3.6-13ubuntu3.6 and curl 7.21.6

hoping someone can confirm if this is happening to others and that it is normal behvaiour;

when a cookie is apended via Set-Cookie it is joined with a comma if the cookies are set via CURLOPT_HTTPHEADER and with a semi-colon if the cookies are set via CURLOPT_COOKIE.

<snip>
HTTP/1.1 302 Found
Date: Thu, 29 Mar 2012 23:10:51 GMT
Server: Apache/2.2.20 (Ubuntu)
X-Powered-By: PHP/5.3.6-13ubuntu3.6
Set-Cookie: cookie_via_server=1333062651
Location: /test/cookie_tester.php?lol=true
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 49
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

HTTP/1.1 200 OK
Date: Thu, 29 Mar 2012 23:10:51 GMT
Server: Apache/2.2.20 (Ubuntu)
X-Powered-By: PHP/5.3.6-13ubuntu3.6
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 763
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

array(2) {
  ["cookie_via_server"]=>
  string(10) "1333062651"
  ["cookie_via_CO_COOKIE"]=>
  string(10) "1333062651"
}
array(28) {
  ["HTTP_COOKIE"]=>
  string(61) "cookie_via_server=1333062651; cookie_via_CO_COOKIE=1333062651"
...
</snip>

<snip>
HTTP/1.1 302 Found
Date: Thu, 29 Mar 2012 23:25:23 GMT
Server: Apache/2.2.20 (Ubuntu)
X-Powered-By: PHP/5.3.6-13ubuntu3.6
Set-Cookie: cookie_via_server=1333063523
Location: /test/cookie_tester.php?lol=true
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 55
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

HTTP/1.1 200 OK
Date: Thu, 29 Mar 2012 23:25:23 GMT
Server: Apache/2.2.20 (Ubuntu)
X-Powered-By: PHP/5.3.6-13ubuntu3.6
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 773
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

array(1) {
  ["cookie_via_server"]=>
  string(47) "1333063523, cookie_via_CO_HTTPHEADER=1333063523"
}
array(29) {
  ["HTTP_COOKIE"]=>
  string(65) "cookie_via_server=1333063523, cookie_via_CO_HTTPHEADER=1333063523"
...
</snip>

I also noticed that if cookies are set via BOTH CURLOPT_HTPPHEADER and CURLOPT_COOKIE, only the cookies from CURLOPT_HTTPHEADER are considered.

<snip>
HTTP/1.1 302 Found
Date: Thu, 29 Mar 2012 23:26:22 GMT
Server: Apache/2.2.20 (Ubuntu)
X-Powered-By: PHP/5.3.6-13ubuntu3.6
Set-Cookie: cookie_via_server=1333063582
Location: /test/cookie_tester.php?lol=true
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 55
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

HTTP/1.1 200 OK
Date: Thu, 29 Mar 2012 23:26:22 GMT
Server: Apache/2.2.20 (Ubuntu)
X-Powered-By: PHP/5.3.6-13ubuntu3.6
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 748
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html

array(1) {
  ["cookie_via_server"]=>
  string(47) "1333063582, cookie_via_CO_HTTPHEADER=1333063582"
}
array(28) {
  ["HTTP_COOKIE"]=>
  string(65) "cookie_via_server=1333063582, cookie_via_CO_HTTPHEADER=1333063582"
...
</snip>

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3513010&group_id=976
Received on 2012-03-30

These mail archives are generated by hypermail.

donate! Page updated January 05, 2012.
web site info

File upload with ASP.NET