2 Replies Latest reply on Feb 19, 2009 11:52 AM by

    HELP NEEDED:: variable SESSION is undefine

      Guys, help me out; PLEASE. I'm stuck on this for days and am running out of options.
      I have a CFC that checks some session variables for validation (client login etc), and I have a RemoteObject call to said CFC.
      All my other CFCs that do not reference session variables work fine; this one bunks right when my CFC checks the session variables.
      I tried webservices, no-go (hell, I couldn't even see the faultString!!).
      I played around with my CF8 server settings and tried everything.
      I tried Ben Forta's blogs (and posted a question there) but didn't get much help,

      HOW CAN I ACCESS A CFC THAT REFERENCES SESSION VARIABLES WITHOUT CREATING A GET/SET METHOD TO GET/SET THESE SESSION VARIABLES!!!! (Obvious security risk).
        • 1. Re: HELP NEEDED:: variable SESSION is undefine
          John Hall Level 4
          Not sure I'm following what you're trying to do. In my mind, your asking to have Flex call to a CFC that's not in its session to begin with. Maybe a little more detail is needed. Are you saying they come into the side and the Flex app is embedded inside cfm pages that are part of the site and in the same session? If so, have you tried changing the file wrapper to a cfm instead of html so CF is handling it? I'm curious why you don't have them log in with Flex and use the CFC to do the checks in the database and return true or false as to isAuthorized or something? If your other CFCs are working, that would work.
          1 person found this helpful
          • 2. Re: HELP NEEDED:: variable SESSION is undefine
            Thank you for your reply John,
            Sorry I wasn't clear in my description.
            I do -in fact- have a CFC check my client's log-in and return a true or false, however in subsequent site functionality, it is the norm to see whether the session has expired or not. From Flex I am using a RemoteObject call to a CFC; the CFC has the following if statement:

            <cfif IsDefined(SESSION.CLIENT.boolClientLoggedIn)>
            <cfif SESSION.CLIENT.boolClientLoggedIn eq "true">
            <cfthrow message="Attempting to call fncClientWebSignup when client is logged in.">
            </cfif>
            </cfif>

            The faultString I get in Flex is 'Variable SESSION is undefined.'

            Also, I did try to change my wrapper from html to cfm and still no success. Not only that, but I've tried Webservices (which failed miserably because I couldn't even get the details of the SOAP fault!!!).
            I built a test cfm page that tests my cfcs (instead of Flex calling them, I had the cfm call the same cfcs) and Session variables were defined and everything went well.
            It so happens that when Flex calls the SAME cfcs, the SESSION variable is undefined.

            I hope this clears up my problem.