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

curl-and-php

Re: Sessions in CURL

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 11 Jun 2001 09:42:55 +0200 (MET DST)

On Sat, 9 Jun 2001, Vladimir wrote:

> I am triyng to send form to the https:// server under IIS 4.0 through
> several pages. This server support sessions.

AFAIK, there's nothing in the standards called "sessions". I take it you mean
this server sends and expects cookies?

> 1. Authorization - exec("C:/PHP/curl -m 120 -D 111.txt -d Password=Password -d
> Login=Login -d Sumbit=Submit https://secure.server.com/login.asp");

> I get the result that my page is moved somewhere in other place (I
> needn't it)

How do you know you don't need it? Cookies are always sent together with a
"page", so if you're not getting the page you're redirected to, you might
miss the cookies the server wants you to have.

> On the disk I have a file Where there are a string like
> "Set-cookie: ASPSESSIONIDGQQQGGEK=JNFLHLEAMBEDHICAAKNIGICG; path=/";

There's a cookie, yes.

> 2.Now I send the form to the other page on this server and a call -b
> 111.txt
> exec("C:/PHP/curl -m 120 -b 111.txt -d Name=Name -d
> Something=Somthing -d Sumbit=Submit -e
> https://secure.server.com/login.asp
> https://secure.server.com/form.asp");

I take it that if you use -v there, you get to see the full request that
includes the cookie being sent to the server, right?

> BUT I have been sent to the first page https://secure.server.com/login.asp
> That request Login and Password.

> Could somebody explain me what is happening. What is wrong in my script.
> How can I pass session to the server, or is it something else that I
> escaped.

As always, start with doing everything that a browser would do.

I think your decision to not follow the initial location is your mistake in
this case. But that's just a guess. It could just as well be that your
user-agent string is bad or that it was run during a weekend, we can never
really be sure... (unless you contact the server admins and ask them)

-- 
     Daniel Stenberg -- curl dude -- http://curl.haxx.se/
_______________________________________________
Curl-and-php mailing list
Curl-and-php_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-and-php
Received on 2001-06-11