title: How can I use/access SESSION variables in a remote method of a ColdFusion CFC?
body: <p>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. </p>
  
  <p>For instance, let's say I set a SESSION variable upon login called <code>SESSION.IsMale</code>.</p>
  
  <p>In my remote CFC method, I run the following code:</p>
  
  <pre><code>&lt;cffunction name="getFavoriteColor" access="remote" returntype="String"&gt;
      &lt;cfif SESSION.IsMale&gt;
          &lt;cfreturn "blue" /&gt;
      &lt;/cfif&gt;
  
      &lt;cfreturn "pink" /&gt;
  &lt;/cffunction&gt;
  </code></pre>
  
  <p>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. </p>
  
  <p>I don't want to store the values in the page as Global JavaScript variables, since that defeats the purpose of keeping them secure.</p>