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

curl-and-php

Re[2]: Sessions in CURL

From: Vladimir <vladkalmik_at_yahoo.com>
Date: Mon, 11 Jun 2001 13:22:46 +0300

Hello Daniel,

Monday, June 11, 2001, 10:42:55 AM, you wrote:

DS> 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.

DS> AFAIK, there's nothing in the standards called "sessions". I take it you mean
DS> 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)

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

OK. One more question.
How can I store cookies into a file (In binary curl I have to do -D somefile.txt)
What is the same command in builded into PHP CURL module (I see only
CURLOPT_COOKIEFILE but it can only pass cookies but not create and
store cookies)

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

DS> 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");

DS> I take it that if you use -v there, you get to see the full request that
DS> 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.

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

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

-- 
Best regards,
 Vladimir                            mailto:vladkalmik_at_yahoo.com
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
Curl-and-php mailing list
http://curl.haxx.se/
Received on 2001-06-11