Skip to main content
February 12, 2015
Answered

Application.cfm or a .cfc

  • February 12, 2015
  • 2 replies
  • 3440 views

I'm working on updating some apps we currently use for AD user maintenance. i.e. add new users, unlock accounts, reset passwords, etc.)

We use cgi.auth_user and then parse that to get the domain and userid of the Windows user accessing the app. We then take the user id portion of that and use that as the filter in a cfldap query. that pulls attributes we use to control access, and timestamp transactions.

That cfldap query is included in a number of pages throughout the app and I wanted to move that to either the Application.cfm file, or create a .cfc file (something we're not currently using) and put it there.

We're on ColdFusion 11, are there advantages/disadvantages to either of these methods?

Mahalo;

Charles

This topic has been closed for replies.
Correct answer BKBK

Generally speaking, Application.cfc has only advantages over Application.cfm. This is because Application.cfc was designed to address the shortcomings of Application.cfm and to include further fine-grained functionality that developers need.

2 replies

February 18, 2015


BK,

Made the changes per your instructions, works great.

Thanks again. Great forum.

BKBK
Community Expert
Community Expert
February 18, 2015

I am glad to hear. Thanks.

BKBK
Community Expert
BKBKCommunity ExpertCorrect answer
Community Expert
February 13, 2015

Generally speaking, Application.cfc has only advantages over Application.cfm. This is because Application.cfc was designed to address the shortcomings of Application.cfm and to include further fine-grained functionality that developers need.

February 13, 2015

Thanks, was kind of thinking that was the case, but as you could probably tell, I'm fairly new to ColdFusion.

One last question, I'm planning on using the client scope for the variables created for the users AD attributes, would that be the proper scope? In addition to using those variables in the timestamp for the transactions, I'll also be using them for controlling access to pages, setting menus, etc.

Mahalo

BKBK
Community Expert
Community Expert
February 13, 2015

The scope to use to store user-specific data that changes dynamically is session. Common examples are shopping-cart content and the boolean variable that says whether or not the user is currently logged in.

If the user-specific data is unchanged between sessions and of long-term nature, then you should store it as client variables. Common examples are date of last visit and personal  site display preferences.