I am sending an HTTP request to two different URL's, both CF sites.

Both URL's erratically return cookie info as in the response header.(One
URL most of the time, and the other seldom). When cookie info is returned
as part of the response header the cookie data will not always copy into
"cookieArray" below. At the bottom I have included the results of the
Set-Cookie variable in cfhttp.responseHeader struct, for when cookie info
is returned..

Extracting the cookie info from cfhttp.responseHeader struct in the
following code doesn't consistently create an array.

Any ideas or suggestions would be greatly appreciated.

Thanks,

Nick

----Code

<cfhttp
   url = "">    resolveurl = 1
   throwOnError = "Yes"
>

<cfdump var="#cfhttp.responseHeader#"><br><br>

<cfset cookieArray=cfhttp.responseHeader["set-cookie"]>

<p>Is this an array? #IsArray(cookieArray)#</p>

<cfif Isdefined("cookieArray[1]")>
cookieArray[1] is defined<br>
</cfif>

----Results

Set-Cookie variable in cfhttp.responseHeader struct

struct
1 CFCLIENT_REMOTEPINGER=; expires=Tue, 27-Jan-2004 18:15:49 GMT; path=/;

2 CFCLIENT_REMOTEPINGER=; expires=Tue, 27-Jan-2004 18:15:49 GMT; path=/;
domain=.loyalguardian.com;

3 CFGLOBALS=; expires=Tue, 27-Jan-2004 18:15:49 GMT; path=/;

4
CFGLOBALS=HITCOUNT%3D1%23LASTVISIT%3D%7Bts+%272004%2D02%2D26+18%3A15%3A49%27%7D%23TIMECREATED%3D%7Bts+%272004%2D02%2D26+18%3A15%3A49%27%7D%23;
expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/; domain=.loyalguardian.com;

5 CFID=301868; expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/;
domain=.loyalguardian.com;

6 CFMAGIC=301868%3A92231158; expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/;
domain=.loyalguardian.com;

7CFTOKEN=92231158; expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/;
domain=.loyalguardian.com;
Status_Code 200
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to