Getting a URL form a "logged in" site
Dennis Brown
see3d at writeme.com
Tue Dec 20 21:11:06 EST 2005
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_au7wqv
uZzszKGecKq4R6CAqgrPcnGwy1uRSmnPZd3gyvq6AeS0AuXvfR3e059Xcq35Opu6-
phKMbTR8z6ypKeaL4hQdBv-
J1YkzAHELp0EP7RGUXutasf9H_HgUKCa5t4Ib2pj4y9tfKGecKq4R6CAqgrPcnGwy1eZPpWt
vxyhGi3dOjTPgKgWyDbj7RfDY2IFW-
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
More information about the use-livecode
mailing list