• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Session Objects

Community Beginner ,
Feb 14, 2008 Feb 14, 2008

Copy link to clipboard

Copied

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,
Drew
TOPICS
Advanced techniques

Views

279

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 14, 2008 Feb 14, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 14, 2008 Feb 14, 2008

Copy link to clipboard

Copied

Dan,

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.

Thanks,
Drew

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 15, 2008 Feb 15, 2008

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation