Can you believe it?  I did this 2 years ago, using CFX_HTTP, since CFHTTP 
did not handle SSL connections at the time.

So here's the code, for your perusal.

It should work with the <CFHTTP> tag in 4.5 by replacing CFX_HTTP.HEADERS 
with CFHTTP.RESPONSEHEADER.

<cfx_http
         URL = #Request.InternalLogonPage#
         VERB="POST"
         TIMEOUT=15
         FORMDATA= #FormData#
         >

<CFIF CFX_HTTP.ResponseCode EQ 200>

         <cfset CookieMarker = FindNoCase("Set-Cookie: 
#CookieName#",CFX_HTTP.Headers)>
         <cfset HeaderLen = Len(CFX_HTTP.Headers)>
         <cfset MyCookiePlus = Right(CFX_HTTP.Headers,HeaderLen - 
CookieMarker - 17)>
         <cfset EndCookieMarker = FindNoCase(chr(10),MyCookiePlus)>
         <cfset MyCookie = Left(MyCookiePlus,EndCookieMarker-2)>

<CFELSE>
         <cfabort showerror="There was an HTML error.<hr>Return code: 
#CFX_HTTP.ResponseCode#">
</CFIF>

Later on in the code, we set the exact same cookie on the user's browser, 
so the server would think the user was authorized to continue.  Watch that 
path setting!

<CFHEADER name="Set-Cookie" value="#CookieName#=#MyCookie#;path=/scripts/">



At 07:30 PM 3/30/01, Fred T. Sanders wrote:
>oh, guess I could be nice and mention that with a little creative looping,
>and use of listfirst() and listlast(), you can get the cookie information
>from the raw header information  (i.e: #CFHTTP.RESPONSEHEADER#) and then use
><cfhttpparam type="Cookie" to pass the values back with the next page
>request.
>
>Fred
>
>----- Original Message -----
>From: "Wallick, Mike" <[EMAIL PROTECTED]>
>To: "Fusebox" <[EMAIL PROTECTED]>
>Sent: Friday, March 30, 2001 5:00 PM
>Subject: OT: cfhttp to an asp page does not return cookies?
>
>
> > Hey everyone
> >
> > A little off topic, hope you don't mind.
> >
> > So I'm using cfhttp to go out and get content from an ASP page on a remote
> > server.
> >
> > It's an IIS extension for Citrix, and it gives you a web page with the
> > published apps you can access.
> > I had the idea that it would be really cool if, on our intranet home page
> > (CF & fusebox), you could log in to Citrix, use cfhttp to get the content
> > from the remote ASP page, and display it in a table cell on the home page.
> > That part works great. I get the list of apps I should.
> >
> > Now, when I go and click one of the links to open one of the published
>apps,
> > the cookie data the citrix server wants doesn't exist. I am using
> > type="cookie" in the cfhttpparam tags, I also tried type="formfield" and
>I'm
> > just not getting what I want. Is this even possible???
> >
> > If I'm begin a moron, let me know.
> >
> > Mike
> >
> >
> >
> >
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to