title: SESSION variables in structure' with 'type' 'Array'
body: <p>Hi I have a CFC/component by name "tsks_Session", that performs the session tasks. In this cfc/ init () function, created a structure that contains all the variables needed in the application.Some of the variables are array types. </p>
  
  <pre><code>&lt;cfcomponent  &gt;
          &lt;cffunction name="init"&gt;
          &lt;cfargument name="structKey" &gt;
          &lt;cflock timeout="35" &gt;
           &lt;cfset SESSION = structNew() &gt; 
           &lt;cfset SESSION.bar_code = "" &gt; 
           &lt;cfset SESSION.price = "" &gt;  
           &lt;cfset SESSION.pub_date = "01/01/1900" &gt; 
           &lt;cfset SESSION.author = ArrayNew() &gt;
           &lt;cfset SESSION.title = ArrayNew() &gt;    
           &lt;cfset SESSION.[bar_code_subj_pric] = structNew() &gt; &lt;!--- key = concatanation of    
                                                               bar_code and price ---&gt;
           &lt;cfset SESSION.[bar_code_subj_pric].author = ArrayNew() &gt;
           &lt;cfset SESSION.[bar_code_subj_pric].title = ArrayNew() &gt;
          &lt;/cflock&gt;
        &lt;/cffunction&gt;
       &lt;!---getter---&gt;
       &lt;cffunction name="getAuthor" returntype="array" access="public" output="false"&gt; 
         &lt;cfscript&gt;return SESSION.author;   &lt;/cfscript&gt; 
       &lt;/cffunction&gt;
       &lt;!---setter:adding the Array/"author"  to the structue/"SESSION.[bar_code_subj_pric]" ---&gt;
       &lt;cffunction name="setAuthor" retuntype="void" access="public" output="false"&gt; 
       &lt;cfargument name="bar_code_subj_pric" type="string"  required="true"&gt;
       &lt;cfargument name="author" type="array"  required="true"&gt;
       &lt;cfset var q = "" &gt;
       &lt;cfparam name="author" default="" &gt;
        &lt;cfloop index="i" from="1" to="arrayLen(SESSION.[bar_code_subj_pric].author)"&gt;
         &lt;cfset SESSION.author = ArrayAppend(SESSION.[bar_code_subj_pric].author,"#arguments.author#")&gt;
        &lt;/cfloop&gt;
       &lt;/cffunction&gt; 
  
       &lt;!---getter.title---&gt;
       &lt;cffunction name="gettitle" returntype="array" access="public" output="false"&gt; 
         &lt;cfscript&gt;return SESSION.title;   &lt;/cfscript&gt; 
       &lt;/cffunction&gt;
       &lt;!---setter:adding the Array/"title"  to the structue/"SESSION.[bar_code_subj_pric]" ---&gt;
       &lt;cffunction name="settitle" retuntype="void" access="public" output="false"&gt; 
       &lt;cfargument name="bar_code_subj_pric" type="string"  required="true"&gt;
       &lt;cfargument name="title" type="array"  required="true"&gt;
       &lt;cfset var q = "" &gt;
       &lt;cfparam name="title" default="" &gt;
        &lt;cfloop index="i" from="1" to="arrayLen(SESSION.[bar_code_subj_pric].title)"&gt;
         &lt;cfset SESSION.title = ArrayAppend(SESSION.[bar_code_subj_pric].title,"#arguments.title#")&gt;
        &lt;/cfloop&gt;
       &lt;/cffunction&gt;  
      &lt;/cfcomponent&gt;
  </code></pre>
  
  <p>1) on an display page, having instanitiated the cfc,
  i created a str called </p>
  
  <pre><code>&lt;cfset str[expld133] =structnew()&gt;
  </code></pre>
  
  <p>when i output the functions setAuthor("expld133",Kelly)/setTitle("expld133",33.22), i get <code>"The value that i am not passing an array type".</code>
  Kindly tell me whats wrong?</p>
  
  <p>2) can i create an structure called simply "SESSION" is it safe?</p>
  
  <p>3)is there error in the way i am adding 2 different arrays(Author/Title) to the main structure "SESSION.[bar_code_subj_pric]"?</p>