Nick,

Try CFDUMPing the cfhttp scope.

<cfdump var="#cfhttp#">

If the Set-Cookie header is in the response, it should be in the
responseHeader structure.

I would expect this to produce the cookie headers (note plural):
  <cfdump var="#cfhttp.responseHeader["set-cookie"]#">

If their is more than 1 Set-Cookie header (which there is in your example
below),
then this will dump an array, one entry for each value.

So you will need to process
  <cfset cookieArray=cfhttp.responseHeader["set-cookie"]>
  <cfset value1=cookieArray[1]>
  <cfset value2=cookieArray[2]>

Hope this helps.

See the livedocs for details:


http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-p58.htm#wp163296
6

--
Tom Jordahl
Macromedia

-----Original Message-----
From: Nick Baker [mailto:[EMAIL PROTECTED]
Sent: Monday, November 03, 2003 5:52 PM
To: CF-Talk
Subject: RE: Extracting CFID and CFTOKEN?

Mark,

I started this thread and will share with you what I have learned. The goal
of the original question was to locate a variable for CFID and CFTOKEN. Let
me qualify --  I haven't found the answer I was wanting, but that could be
because the answer doesn't exists in that fashion. I greatly appreciated
Dave Watts help or I would still be wondering around with absolutely
nothing.

1. The only place that the returned CFID and CFTOKEN appear, that I can
find, is in CFHTTP.HEADER. So far it appears that CFHTTP.HEADER is just a
variable stuffed with useful, but loosely identifiable info. Here is the
code used to display the info and the results.

<cfoutput>
header = #cfhttp.header#<br><br>
</cfoutput>

Results:

header = HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Mon, 03 Nov 2003
22:31:42 GMT Content-type: text/html Page-Completion-Status: Normal
Page-Completion-Status: Normal Set-Cookie: CFID=101; expires=Sun,
27-Sep-2037 00:00:00 GMT; path=/; Set-Cookie: CFTOKEN=47326262;
expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/;

As you can see the CFID and CFTOKEN are there but CFHTTP.HEADER doesn't
respond to any delimited sort of array, list or even a structure probes.

2. The other option that appeared to be a solution was the
CFHTTP.ResponseHeader. The following code resulted in the below which as
you can see does not include CFID and CFTOKEN.

<cfoutput>
<table border=1>
<cfloop collection="#CFHTTP.ResponseHeader#" item="header">
         <tr><td>#header#</td><td>#CFHTTP.ResponseHeader[header]#</td></tr>
</cfloop>
</table>
</cfoutput>

Results:

CONTENT-TYPE text/html
DATETue 04 Nov 2003 01:01:40 GMT
EXPLANATION OK
HTTP_VERSION HTTP/1.1
SERVER Microsoft-IIS/5.1
STATUS_CODE 200

Hope this helps.

Nick

At 04:57 PM 11/3/2003 -0500, you wrote:
>I'm facing a similar situation, so how would this be written?
>
>"Instead, you'll have to look in the Set-Cookie response header for CFID
and
>CFTOKEN with no prefixes."
>
>Thanks, Mark
>
>-----Original Message-----
>From: Dave Watts [mailto:[EMAIL PROTECTED]
>Sent: Monday, November 03, 2003 8:57 AM
>To: CF-Talk
>Subject: RE: Extracting CFID and CFTOKEN?
>
>
> > > Anyone know the code to extract CFID and CFTOKEN from
> > > CFHTTP.HEADER or CFHTTP.RESPONSEHEADER? I can see both
> > > CFID and CFTOKEN are embedded in CFHTTP.HEADER, but I
> > > can't seem to find the right variable for
> > > CFHTTP.RESPONSEHEADER [???] to pluck those out.
> >
> > If you are using it for session: session.cfid, session.cftoken
> > For client: client.cfid, client.cftoken
>
>None of that stuff will be available when you're using CFHTTP as a client
to
>fetch a CF page.
>Dave Watts, CTO, Fig Leaf Software
>http://www.figleaf.com/
>voice: (202) 797-5496
>fax: (202) 797-5444
>
>   _____
>
>
>


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to