3 Replies Latest reply on Feb 15, 2008 5:13 AM by Grizzly9279

    Session Objects

      My question revolves around the session scope and the proper use of it. our site doesnt necessarily require the user to be logged in to purchase a product, i use different session variables for different products to check the time out period specified in the application.cfm file. is there any specific problems that could arise from this?

      Second question is: what are the thoughts behind storing an object in the session scope? Basically I want to create an object at the beginning of the order and carry it through using the session.object to call different methods in the cfc to give it a true OO feel and make it easier to update in the future.

      I appreciate the help,
        • 1. Re: Session Objects
          Dan Bracuk Level 5
          Session variables are useful irrespective of login requirements. I can't remember ever doing it myself, but I see no reason to not make an object a session variable if it suits the needs of your app.

          For your specific post, I'm not sure why you would use session variables for products to determine a timeout, but it's not my application.
          • 2. Re: Session Objects
            tbaggz Level 1

            I guess I should have been more specific, our products/services contain multiple pages of forms to gather the proper information, that is why we use a session timeout to protect the users information without actually being logged into the system. I have started building it with the session object and it is working well, im looking forward to seeing how it turns out. Thanks for the input it is certainly appreciated.

            • 3. Re: Session Objects
              Grizzly9279 Level 1
              We've been storing CFCs in the session scope for years, and it works great for the most part.

              There is one caveat (which is no longer an issue if you're using ColdFusion 8). And that is...if you're using ColdFusion 7 or earlier in a clustered environment...session replication from one cluster node to another will corrupt your session-based CFCs, since previous to CF 8, CFCs were not serializable.

              So...if you're on ColdFusion 8, great! No worries. If not, and you're using ColdFusion 7 or earlier, but you're NOT in a clustered environment, than no worries there either. You only need to worry if you're using CF 7 (or earlier) in a clustered environment.

              I hope this helps.