cURL / Mailing Lists / curl-users / Single Mail



From: sam tube <>
Date: Tue, 25 Mar 2008 21:34:18 +0800 (CST)

insaini <> wrote:
    From: [] On Behalf Of Ralph Mitchell
Sent: March 23, 2008 11:19 PM
To: the curl tool
Subject: Re: SSL + Cookies

  On Sun, Mar 23, 2008 at 9:14 PM, insaini <> wrote:
      The cookies are not received by curl at all and do not get stored in the
cookie jar. I have tried using preg_match to extract the cookies directly
from the response and there is nothing except for the JSESSIONID even though
in Live Http Headers for firefox it says there are ..

The curl version is 7.18 (I finally got it installed and compiled with php

It may be easier for you to try it yourself actually..

This is the link

it will redirect you to the login page (although Im not entirely sure that
it is an actual redirect) ..

using Live HTTP headers you'll see exactly what I mean
The first page gives back a page with a META refresh tag that has a big url. Fetching *that* link returns a page containing this little bit of javascript:

        sTestCookie = "CPC_TEST_COOKIE";
        oDate = new Date();
        oDate.setFullYear(oDate.getFullYear() + 10);
        sDate = oDate.toGMTString();
        sCookieListUPC = sTestCookie + "=TEST; expires=" + sDate + "; path=/";
        document.cookie = sCookieListUPC;
                location = "browser_error.htm";

So, the web browser is generating the CPC_TEST_COOKIE on-the-fly. Curl doesn't even attempt to execute the javascript. You'll need to examine the page content and deal with any script-generated cookies yourself.

Ralph Mitchell
  Hi Ralph, I saw the it is creating CPC_TEST_COOKIE through javascript.. but there are other cookies beyond CPC_TEST_COOKIE that are missing..
  Here is the list,
  Why are these cookies not being retrieved when they are not generated by the page but passed.. ?

Tired of visiting multiple sites for showtimes?
  Yahoo! Movies is all you need
Received on 2008-03-25