cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Getting and passing a cookie...

From: Paperstuff.com <contact_at_paperstuff.com>
Date: Mon, 17 Feb 2003 10:32:11 -0800

Here is the header that has the cookies. Here you see the cookies, because I put USERNAME and PASSWORD - which obviously aren't my real ones, so it gave the different header. If I put my actual username and password in, it gives the much smaller header.

The version of cURL in use is libcurl 7.9.7 (OpenSSL 0.9.6c). Getting page...
HTTP/1.1 100 Continue Server: Microsoft-IIS/4.0 Date: Mon, 17 Feb 2003 18:26:46 GMT HTTP/1.1 302 Object Moved Server: Microsoft-IIS/4.0 Date: Mon, 17 Feb 2003 18:26:46 GMT Connection: close Location: http://signin.ebay.com/aw-cgi/eBayISAPI.dll?MfcISAPICommand=SignInWelcome&userid=USERNAMEHERE&pass=PASSWORDHERE&keepMeSignInOption=1 HTTP/1.1 200 OK Server: Microsoft-IIS/4.0 Date: Mon, 17 Feb 2003 18:26:46 GMT Connection: close Content-Type: text/html HTTP/1.1 302 Object Moved Server: Microsoft-IIS/4.0 Date: Mon, 17 Feb 2003 18:26:56 GMT Connection: close Location: http://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn&pUserId=USERNAMEHERE&co_partnerId=2&siteid=0&pageType=-1&errmsg=8&pa1=&i1=-1&UsingSSL=0&bshowgif=0 HTTP/1.1 200 OK Server: Microsoft-IIS/4.0 Date: Mon, 17 Feb 2003 18:26:56 GMT Connection: close Content-Type: text/html HTTP/1.1 200 OK Server: Microsoft-IIS/4.0 Date: Mon, 17 Feb 2003 18:26:56 GMT Connection: close Set-Cookie: s=AQAAAAEAAAASAAAARgAAAHApUT7wY1o+QDE5OC42NC4xMjkuNDVlMXRlc3RDb29raWUgJDIkTW96aWxsYS8kTlk0dEFlbG1JY3U0NHdxcjBuLzRpLwA*n; path=/; domain=.ebay.com Set-Cookie: secure_ticket=n; path=/; domain=.ebay.com; secure Set-Cookie: ebaysignin=; path=/; domain=.ebay.com Set-Cookie: secure_ticket_l2=n; path=/; domain=.ebay.com; secure HTTP/1.1 200 OK Server: Microsoft-IIS/4.0 Date: Mon, 17 Feb 2003 18:26:56 GMT Connection: close Set-Cookie: s=AQAAAAEAAAASAAAARgAAAHApUT7wY1o+QDE5OC42NC4xMjkuNDVlMXRlc3RDb29raWUgJDIkTW96aWxsYS8kTlk0dEFlbG1JY3U0NHdxcjBuLzRpLwA*n; path=/; domain=.ebay.com HTTP/1.1 200 OK Server: Microsoft-IIS/4.0 Date: Mon, 17 Feb 2003 18:26:56 GMT Connection: close Content-Type: text/html

  ----- Original Message -----
  From: Daniel Stenberg
  To: curl and php list
  Sent: Monday, February 17, 2003 5:25 AM
  Subject: Re: Getting and passing a cookie...

  On Mon, 17 Feb 2003, Paperstuff.com wrote:

> Ok, it is 5 am and I just spent 7 hour straight on this. Need to get some
> sleep... What is really odd is that if I put my password or something in
> WRONG, it spits out the cookies and I can see them. Yet, if I put the info
> in correctly, you cannot see the cookies. It looks like there are two.
> Further, I see I am using 7.9.7. Have things changed to where it explains
> why this won't work?

  Yes, there have been cookie parsing bug fixes since then.

> The header I provided is the only one. Should there be two or something?

  Well, those headers didn't contain any set cookies so therefore I asked. If
  it returns saying you lack cookies, it means it expected THIS request to pass
  on cookies which you apparently didn't. Perhaps you need to get a previous
  page first to get an initial set of cookies that is then passed on when you
  get this page?

  Many sites work that way and when I do things like this, I usally have curl
  load the login-form HTML page first, which also makes it behave even more
  like a true web browser.

  --
   Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.

  -------------------------------------------------------
  This sf.net email is sponsored by:ThinkGeek
  Welcome to geek heaven.
  http://thinkgeek.com/sf

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-02-17