Yep, typo.  Sorry about that.

-----Original Message-----
From: Chunshen Li [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 24, 2004 1:51 PM
To: CF-Talk
Subject: Re: Break the block, and SURVIVE, any way?

Yes, your follow-up makes a lot of sense to me except the GET method in the
following block, is it a typo? meant to be POST? I thought cfhttpparam
subtag is used with POST method only.

Thanks.

<!--- Now send the cookies back to the server on our next request --->
<cfhttp url="" http:// <http://www.whatever.com/index.html>
www.whatever.com/index.html"
    useragent="Mozilla/4.0"
    method="get">

<cfloop from="1" to="#arrayLen(cookies)#" index="x">
    <cfhttpparam type="COOKIE" name="#ListFirst(cookies[x],'=')#"
value="#ListRest(cookies[x],'=')#">
</cfloop>

</cfhttp>

>When you do an <cfhttp> request, you may or may not receive cookies FROM
the
>server.  To determine if you have, simply look at the "responseHeader".  If
>you have, and you need to send those BACK to the server, that is when you
>want to use the <cfhttpparam type="COOKIE"> code.  The following code
>connects to a server, gets the cookies and then connects back using the
>cookies that were just sent.
>
>I have to do this quite frequently when I'm connecting to websites that use
>cookies to determine whether or not to display an advertisement before
>showing the page that you're really trying to access.  I hope this helps.
>
><cfhttp url="" http:// <http://www.whatever.com/index.html>
>www.whatever.com/index.html"
>useragent="Mozilla/4.0">
></cfhttp>
>
><!--- Take a look at the cookies that the server sent to ME --->
><cfdump var="#cfhttp.responseHeader#">
>
>
><!--- Create an array to hold the cookies that the server sent --->
><cfset cookies = ArrayNew(1)>
><cfset counter = 1>
><!--- Loop through the cookies from the response header --->
><cfloop item="currItem" collection="#cfhttp.responseHeader["Set-Cookie"]#">

>    <cfset cookies[counter] = ListGetAt(
>cfhttp.responseHeader["Set-Cookie"][currItem], 1, ";" )>
>    <cfset counter = counter + 1>
></cfloop>
>
><!--- Now send the cookies back to the server on our next request --->
><cfhttp url="" http:// <http://www.whatever.com/index.html>
>www.whatever.com/index.html"
>    useragent="Mozilla/4.0"
>    method="get">
>
><cfloop from="1" to="#arrayLen(cookies)#" index="x">
>    <cfhttpparam type="COOKIE" name="#ListFirst(cookies[x],'=')#"
>value="#ListRest(cookies[x],'=')#">
></cfloop>
>
></cfhttp>
>
>
>
>
>
>-----Original Message-----
>From: Chunshen Li [mailto:[EMAIL PROTECTED]
>Sent: Monday, February 23, 2004 9:53 AM
>To: CF-Talk
>Subject: Re: Break the block, and SURVIVE, any way?
>
>
>
>Now, I'm totally confused or have not waken up yet :)
>It seems either ua problem or cookie problem or both.
>But here's my take on this "fiasco", this particular case, process
>flow-wise,
>normally a web client sends a request to a remote web server,
>the server checks ua and write some cookes to the requesters, if
successful,
>
>send back requested info/web page, else, redirect to yahoo.
>Now, with my so-called spider, it sends a request to the same server
>telling the server I'm whom whom with the cfhttpparam type="Header"
>value="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)">
>subtag, meantime, it also tells the server, cookies, bla, bla with the
>cfhttpparam type="Cookie" ...
>but here it bugs me,
>"cookie ah, cookie, you're supposed to be crisp
>but ... :) "
>Web server write cookie to requester/web client, aka ua,
>but cfhttpparam type="Cookie" ... seems to say, hey, take this cookie from
>us
>(POST method) instead of accepting a cookie.
>Is my understanding if cfhttpparam type="Cookie" incorrect?
>
>What's the deal here?
>
>Thanks.
>
>  _____
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to