Needed to develop a new proxy function
Nov 10
by Gregory Alexander ColdFusion and Kendo UI

First, we can't get session vars in the main blog.cfc. Raymond (and et-al) had another application.cfm in the org/cambden/blog folder that prevented this component from having access to the session variables set on the /blogCfc/application.cfm template. Cfc's should have access to the session scope unless it finds another application.cfm (or cfc) template, and here, this is the case. This poses some problems with ajax. I do not want to have to hard code authentication variables, like the isAdmin, in a javascript ajax post. This is quite insecure. I tried in vain to get the blog.cfc component to work for my purposes. After finding and eliminating the 'other' application.cfm template which caused problems accessing the session scope, I was able to obtain session variables, but the elimination of the application.cfm template in the same directory caused new problems. One example is that the isUserInRole function is now erroring out with an 'You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members.'. This new error was raised throughout the blog.cfc template. Another issue is that I suspect that the /blogCfc/org/delmore/coldfishconfig.xml file is not working when the application.cfm template is disabled. This file most likely deals with the cfauthentication tag. In order to have the session scope, and in order to potentially cache the code after an ajax operation, I had to develop a new template to act as a proxy. I am not using a .cfc component for ajax post operations as I need the session variables and need to perform client side operations, such as setting form values, and caching the output of the page. Goals: The proxy template will use Raymond's blog.cfc to perform all database operations. Whenever possible, I will perform server side business logic using Raymonds Blog.cfc.
This entry was posted on November 10, 2018 at 12:42 AM and has received 898 views.