Michael,

You are going to have to "get" the cookie scope from your browser and send
it along with the page.

1) Create an ASPX page that loops through the cookie scope and sets
Javascript variables.
2) Embed the ASPX page as a Javascript on your CF page (<script
src="mypage.aspx"/>)
3)  copy the JS variables into the form scope using javascript and post them
to your CF handler 
4) Send them back as cookies in your CFHTTP post...

It's also possible that simply embedding the js/aspx into the CF page will
set the appropriate cookies and you won't need any JS... They will exist as
cookies in your CF cookie scope and your  code below would work. I'm going
to bet that would work differently in different browsers though.

-Mark


-----Original Message-----
From: Michael Nguyen [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 03, 2006 9:10 AM
To: CF-Talk
Subject: RE: Using CFHTTP to login

Claude, if I disable cookie then I couldn't login form the login form that
works if cookie enabled. I think that was the point.

When I submit the form (that works) if cookie turned off then it show me
exactly as when I cfhttp.
How can we get around of it?
What I have tried is do cfhttp twice. The first cfhttp is to get cookie from
asp.net. The second cfhttp is to submit form with the cookie information.
(see the code bellow). However, I haven't got it done yet.

Any thoughts?

<!--- First http request to get cookie info ---> <cfhttp
url="http://www.mycompany.com/Login.aspx"; method="get"
resolveurl="yes" port="80" throwonerror="yes" redirect="yes"
useragent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7)
Gecko/20060909 Firefox/1.5.0.7"/>

<!--- create cookieStruct --->
        <cfset cookieList = cfhttp.responseheader['Set-Cookie']>
        <cfset cookieStruct = Structnew()>
        <cfloop from="1" to="#listlen(cookieList,';')#" index="i">
                <cfset cookieKV = listGetAt(cookieList,i,";")>
                <cfif listLen(cookieKV,"=") gt 1>
                        <cfset cookieKey = listGetAt(cookieKV,1,"=")>
                        <cfset cookieValue = listGetAt(cookieKV,2,"=")>
                        <cfoutput><br> #i# #cookieKey#</cfoutput>
                        <cfset
structInsert(cookieStruct,cookiekey,cookievalue)>
                </cfif>
        </cfloop>

<!--- Second http request to login --->
        <cfhttp url="http://202.134.246.83/Tracking/Login/Login.aspx";
method="post" resolveurl="yes" port="80" 
        redirect="yes"
        useragent="#cgi.HTTP_USER_AGENT#">
        <cfloop collection="#cookieStruct#" item="key">
                        <cfhttpparam type="cookie" name="#key#" value="#
cookieStruct[key]#">
        </cfloop>
                        <cfhttpparam type="formfield" name="CompanyCode"
value="AIRPORT"/>
                        <cfhttpparam type="formfield" name="UserEmail"
value="[EMAIL PROTECTED]"/>
                        <cfhttpparam type="formfield"  name="UserPassword"
value="luggage"/>
                        <cfhttpparam type="formfield"  name="SigninBtn"
value="Login"/>
        </cfhttp>


-----Original Message-----
From: Claude Schneegans [mailto:[EMAIL PROTECTED]
Sent: Saturday, 4 November 2006 1:34 AM
To: CF-Talk
Subject: Re: Using CFHTTP to login

 >>I think that Claude understands me right.

OK, now that we are on the good tracks, let's see.
Could it be the server checking for something in the user browser that you
didn't think of?
Javascript for instance. (My own login procedure on my systems work this
way)
Try your login form that works (and which is NOT the same as the login
action ;-) from your browser with Javascript disabled and see if you can
still login.
Try also with cookie deactivated and see if it makes any difference.

Also, you didn't tell, but what kind of answer do you get in return from
your CFHTTP attempt?
Any message about why the login was refused?

--
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED]) Thanks.






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259048
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to