Getting a URL form a "logged in" site

Dennis Brown see3d at writeme.com
Wed Dec 21 19:36:05 EST 2005


Well, I am getting discouraged with this.  I have done everything  
suggested on this thread.  I am following the redirects, capturing  
all the cookies in a cookie array, and setting the httpHeaders with  
them, but I still can't complete a login successfully.  I guess this  
can get complicated, and it is hard for me to determine what the  
server is looking for vs what it is getting.  I did not set out to  
create a general purpose http transaction engine, but that is what it  
feels like I am headed for!  Not really sure I can succeed at this by  
Christmas at this rate!

With my very limited knowledge of internet protocols (but I learned 5  
times as much as I knew before starting this thread, thanks to this  
list) I might just have to try the altBrowser solution.  I gave the  
demo a try, but it crashed just at the point of downloading the data  
--It did not say that it was compatible with my OS X 10.4 system  
without going for the real license and the latest version though.  It  
is an expensive solution for personal use --costs as much as my DC  
and more than Constellation, but I have spent several days on this  
and I need a solution soon.

I don't want to keep bugging this list forever about this.  You all  
have been so generous with you advice already, and I thank you!

Dennis

On Dec 20, 2005, at 9:38 PM, Brian Yennie wrote:

> Dave & Dennis,
>
> Those headers you report are a redirect which probably needs to be  
> followed.
> What happens if you follow the URL indicated in the "Location"  
> field? That URL seems to indicate from it's name that is has  
> something to do with setting cookies.
>
>> Dave,
>>
>> I am trying to find the cookies...  In response to my login,  
>> libUrlLastRHHeaders() returns this:
>>
>> HTTP/1.1 302 Moved Temporarily
>>
>> Server: Zeus/3.4
>>
>> Date: Wed, 21 Dec 2005 00:59:02 GMT
>>
>> Connection: close
>>
>> Location:
>>
>> http://cookiejar.lycos.com/cgi-bin/mayaCookies? 
>> m_LE=ATFW396OinZbAY4vG4DLdMbB7MgA&m_PR=4&m_CBURL=http%3A%2F% 
>> 2Fwww.quote.com%2Fqc%2Fdefault.aspx%3Fm_E% 
>> 3DvNz1veQGl6DTfuByc_RNFJa9WmMfGBl9GKZclehDhLYVfb4d96S9orrvpajYxL1_au7 
>> wqvuZzszKGecKq4R6CAqgrPcnGwy1uRSmnPZd3gyvq6AeS0AuXvfR3e059Xcq35Opu6-p 
>> hKMbTR8z6ypKeaL4hQdBv- 
>> J1YkzAHELp0EP7RGUXutasf9H_HgUKCa5t4Ib2pj4y9tfKGecKq4R6CAqgrPcnGwy1eZP 
>> pWtvxyhGi3dOjTPgKgWyDbj7RfDY2IFW- 
>> TAfSRynZtFZuwmL88XyUjjeC9dcfL5TXgVnaPQtB4b_p5MCgn- 
>> KrDjOvRXGn&Z=1135126743
>>
>> P3p: CP="CAO DSP COR CURa ADMa DEVa CONo PSAa OUR IND DEM PRE PUR  
>> TAIa NAV UNI"
>>
>> Expires: = -1
>>
>> Window-Target: _self
>>
>> Pragma: no-cache
>>
>> Cache-Control: no-cache, no-store, max-age=0, s-maxage=0, must- 
>> revalidate
>>
>> ########## I am not seeing any set-cookie in there.
>> It kind of looks like it does not like my login request for some  
>> reason.
>> These are the cookies captured by the browser after the login:
>>
>> IFsess=1
>> QANON
>> IF_SessionCookie1
>> A=1
>> ASP.NET_SessionId
>>
>> #########After I make the data request, a bunch more cookies show  
>> up in the browser:
>>
>> MAYA_SSO_4
>> QID
>> QCBASE
>> QB
>> PORTUSERVER
>> IF_SessionCookie1
>> IF_SessionCookie2
>> IF_SessionCookie2
>>
>> ############# Cookies seem to be flying all over the place, but I  
>> just can't seem to find when/how to capture them.  I must be  
>> missing something very fundamental. :-(
>>
>> Dennis
>>
>> On Dec 20, 2005, at 2:48 AM, Dave Cragg wrote:
>>
>>>
>>> On 19 Dec 2005, at 20:30, Björnke von Gierke wrote:
>>>
>>>> I am not sure but it seems you want to set a cookie?
>>>> In that case read the cookie page from netscape:
>>>> http://wp.netscape.com/newsref/std/cookie_spec.html
>>>>
>>>> what you need to do in rev is to get the libURLLastHTTPHeaders()  
>>>> it should contain a line similar to this:
>>>
>>> This should be libUrlLastRHHeaders(). This returns the headers  
>>> received from the remote host's response. (libUrlLastHttpHeaders 
>>> () returns the last headers used by libUrl in a request.)
>>>
>>>
>>>> Set-Cookie: NameOfCookie=Value; path=/; expires=Wednesday, 09- 
>>>> Nov-2006 23:12:40 GMT
>>>>
>>>> You need to set the httpHeaders to this line in response to keep  
>>>> logged in,  showing that you have kept the cookie:
>>>> Cookie: NameOfCookie=Value
>>>>
>>>> Beware: There are ways to have several cookies in the same  
>>>> request! So you need to accommodate for that. Also if you get a  
>>>> Set-Cookie header with a date before the current date, you  
>>>> should delete the cookie.
>>>>
>>>> To pretend to be someone else, you need to to set the "User- 
>>>> Agent:" header to something else using libURLSetCustomHTTPHeaders.
>>>
>>> You should just set the httpHeaders for this as well.  
>>> (libURLSetCustomHTTPHeaders is for setting a complete set of  
>>> headers including the request line, and is probably only useful  
>>> for things such as HEAD or OPTIONS requests.)
>>>
>>> To add multiple headers to the httpHeaders, you can do something  
>>> like this:
>>>
>>> put "Cookie: NameOFCookie=Value" into tMyHeaders
>>> put return & "User-Agent: specialAgentString" after tMyHeaders
>>>
>>> set the httpHeaders to tMyHeaders
>>>
>>> Cheers
>>> Dave
>>>
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your  
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list