4 Replies Latest reply on Feb 24, 2009 4:57 AM by emerys

    How to access ColdFusion session variables from FLEX

      Hello all,
      Is there a way to access Session variables in ColdFusion from Flex?
      I'm accessing ColdFusion CFCs in Flex using Webservice requests. Running Flex SDK 3.2/Flex Builder3/ColdFusion8

      Any help is appreciated!
        • 1. Re: How to access ColdFusion session variables from FLEX
          Michael Borbor Level 4
          If you're communicating with CF, you can create a WS that sends session vars to Flex if you need them.
          1 person found this helpful
          • 2. Re: How to access ColdFusion session variables from FLEX
            Wouldn't that expose my session variables to anyone who accesses the Webservice? (This is because the Webservice scope has to be declared 'remote' for Flex to be able to talk to it).
            Also, how is this different than exposing the session vars through a Get/Set method?
            Not only that, but ColdFusion8 developer guide says that when using Remote Objects (which I am) over AMF, the session variables are sent automatically.
            HOW DO I ACCESS THEM :(?????
            • 3. Re: How to access ColdFusion session variables from FLEX
              Michael Borbor Level 4
              Hi there I don't realy understand what you need, but if you're using Remote Objects and CFCs then you can secure your cfcs using server roles for instance you create a Login CFC then do the login using the cflogin tag, you can send username and password to a CFC using setremotecredentials, then when your user is login you can customize the access with the server role. If you could be a little bit more specific in what you need :-), why do you need to access the session variables?
              1 person found this helpful
              • 4. Re: How to access ColdFusion session variables from FLEX
                One way to pass variables (parameters) into your Flex app is to change the Flex Builder generated .html file that calls your .swf application into a .cfm file (just change the file extension). Then edit that file and look for the AC_FL_RunContent add a property for the Flash Variables like this: "flashVars", "myName=<cfoutput>#CGI.USERNAME#</cfoutput>",
                Then in the Flex application you can call myName = Application.application.parameters.myName;
                This can pass any ColdFusion variables into Flex.
                Scott