This content has been marked as final. Show 3 replies
Why would that CFIF statement in the onRequestStart method interfere
with the CFHTTP block in index.cfm?
Because it is doing exactly what you are telling it to do.
The if statement says if the page is not index.cfm and session.loggedIn
is not defined, then go to login.cfm.
Then you run a cfhttp tag which makes a request to a page named
testPost.cfm which is NOT index.cfm. And since the CF client used to
make that http request has not been LOGGED in and does not have a
session.loggedIn value, the request is redirected to login.cfm. A bit
of an endless loop there.
Remember when one uses <CFHTTP...> it is creating normal http request
just like any other client using a very basic built in 'browser'. It is
subject to any and all restrictions applied to requests.
You're right Ian. I neglected to regard CF as a separate client from my browser--which IS logged in. The CF "browser" of course does not inherit that logged in state. Thanks for the quick reply.
I neglected to regard CF as a separate client from my browser--which IS
logged in. The CF "browser" of course does not inherit that logged in state.
A very common problem, and one of the first things to look at when
debugging <cfhttp...>, <cfftp...>, <cfexecute...>, schedule tasks and
network UNC paths used in <cffile...> and <cfdirectory...> tags. All
these use the permissions of the CF service which usually is very
different then the developer's.