Getting a URL form a "logged in" site
briany at qldlearning.com
Tue Dec 20 20:38:16 CST 2005
Dave & Dennis,
Those headers you report are a redirect which probably needs to be
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.
> 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
> 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,
> ########## I am not seeing any set-cookie in there.
> It kind of looks like it does not like my login request for some
> These are the cookies captured by the browser after the login:
> #########After I make the data request, a bunch more cookies show up
> in the browser:
> ############# 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. :-(
> 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:
>>> 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
>>> 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
>> put "Cookie: NameOFCookie=Value" into tMyHeaders
>> put return & "User-Agent: specialAgentString" after tMyHeaders
>> set the httpHeaders to tMyHeaders
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the use-livecode