27 Replies Latest reply on Sep 25, 2011 10:58 AM by ACS LLC

    Setting session variable names based on variables in a loop

    ACS LLC Level 1

      I am trying to set up a loop that sets up a list of variables based upon a list, by looping over the list and setting the session.NAME:


      <CFLOOP list="#fieldnames#" index="fieldname">

      <cfset session.#fieldname# = "1">



      It does not seem to like session.A_CF_VARIABLE . so session.#fieldname# does not work, I get an error


      A CFML variable name cannot end with a "." character.

      The variable session. ends with a "." character. You must supply an additional structure key or delete the "." character.


      Do I have to wrap it a different way?