Greetings All !

I have an application that goes out and scans pages from several remote sites. It's been working great for months. It uses Curl to do the remote fetching and cookie-handling.

So, the other day, I install this same application on somebody else's site. Everything works fine.... EXCEPT.... that for ONE SITE... simulated logins are not working. (Note: All the other sites do simulated logins in the exact same way: I tell curl to fetch the sign-up page, where an initial cookie gets set. I then tell curl to pass the username / password on to the actual signup form processing script... referring to the previously-set cookie file.)

I'm trying to figure out why this doesn't work for JUST this one remote site... on this OTHER PERSON'S site, not mine.

Here's the code for retrieving the signup page and setting the cookie file (along with several statements I've put in there to assist me with debugging this):

// create cookie file
$starttime=getmicrotime();
$mycookiefile="/home/auction/cookies/".$username."_".$starttime.".txt";
echo "mycookiefile= $mycookiefile <BR>";

$fp = fopen("$mycookiefile","w") or die("<BR><B>Unable to open cookie file $mycookiefile for write!<BR>");
fclose($fp);

// give me a standard error log
$fh = fopen("/home/auction/davez_curl_log.txt",'w') or die("Unable to open davez_curl_log.txt file<BR>");

$ch= curl_init();
$LOGINURL="http://signin.ebay.ca/aw-cgi/eBayISAPI.dll?SignIn&ssPageName=h:h:sin:US";

curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER,1); // return header with output
curl_setopt($ch, CURLOPT_COOKIEJAR, "$mycookiefile");
curl_setopt($ch, CURLOPT_STDERR, $fh);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec($ch);

echo "<BR></BR>";
echo curl_error($ch);
echo curl_version();
print_r(curl_getinfo($ch));
echo "<BR></BR>";
curl_close($ch);
fclose($fh);

OK, now, the initial empty file for the cookie does get created properly. Its chmod is 644... which concerned me at first... but it seems that when I run the other sites through this code, having that at 644 doesn't matter.

The empty cookie file gets created but it NEVER GETS POPULATED with cookie info.

No curl_error is given as feedback. The array curl_getinfo doesn't show anything funny.

And that standard error output file I have set up gives me what looks like the output I'm suppossed to be receiving. Example:

  • About to connect() to signin.ebay.ca:80
  • Connected to signin.ebay.ca (66.135.198.188) port 80

GET /aw-cgi/eBayISAPI.dll?SignIn&ssPageName=h:h:sin:US HTTP/1.1

Host: signin.ebay.ca

Pragma: no-cache

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, /

< HTTP/1.1 200 OK

< Server: Microsoft-IIS/4.0

< Date: Sun, 22 Feb 2004 11:34:57 GMT

< IISExport: This web site was exported using IIS Export v2.2

< Connection: close

< Content-Type: text/html

< Set-Cookie: secure_ticket=n; path=/; domain=.ebay.ca; secure

< Set-Cookie: ebaysignin=; path=/; domain=.ebay.ca

< Set-Cookie: secure_ticket_l2=n; path=/; domain=.ebay.ca; secure

< Set-Cookie: sru=X; path=/; domain=.ebay.ca; expires=Fri, 01-Sep-1995 00:00:00 GMT

< Set-Cookie: s=AQAAAAEAAAASAAAAMwAAAOGTOEBhzkFAMXRlc3RDb29raWUgJDIkJDJnU01BR3FMM2hvdlRJejFrQ1RiWjEAzc3NzQ**l; path=/; domain=.ebay.ca

< Set-Cookie: sru=X; path=/; domain=.ebay.ca; expires=Fri, 01-Sep-1995 00:00:00 GMT

< Set-Cookie: s=AQAAAAEAAAASAAAAMwAAAOGTOEBhzkFAMXRlc3RDb29raWUgJDIkJDJnU01BR3FMM2hvdlRJejFrQ1RiWjEAzc3NzQ**l; path=/; domain=.ebay.ca

  • Closing connection #0

So, I don't get it. I tried googling for help on this. Read a lot of stuff. But I couldn't find any instance of anyone else having this problem.

Is there anything else I can do to debug this to find out what's going on?

I'm at a loss to explain it.

Thanks!

-= Dave =-

    Write a Reply...