I have several methods in CFCs that are accessed remotely via JavaScript. Some of these methods use SESSION variables to determine what logic to run, and thereby, what data to return.
For instance, let's say I set a SESSION variable upon login called SESSION.IsMale
.
In my remote CFC method, I run the following code:
<cffunction name="getFavoriteColor" access="remote" returntype="String">
<cfif SESSION.IsMale>
<cfreturn "blue" />
</cfif>
<cfreturn "pink" />
</cffunction>
Now, I don't want to directly access the SESSION scope in my CFC. So, how can I "access" the SESSION scope when calling this method using AJAX.
I don't want to store the values in the page as Global JavaScript variables, since that defeats the purpose of keeping them secure.