Skip to main content
Feb 12, 2015 5:16 PM UTC
Answered

Application.cfm or a .cfc

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 is closed to new replies. Start a new post to keep the conversation going.
BKBK
BKBKCorrect answer
Community Expert
Feb 13, 2015 3:54 PM UTC

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.

21 replies

Feb 18, 2015 12:29 AM UTC


BK,

Made the changes per your instructions, works great.

Thanks again. Great forum.

Translate
BKBK
Community Expert
Community Expert
Feb 18, 2015 7:49 AM UTC

I am glad to hear. Thanks.

Translate
BKBK
Community Expert
BKBKCommunity ExpertCorrect answer
Community Expert
Feb 13, 2015 3:54 PM UTC

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.

Translate
Feb 13, 2015 5:26 PM UTC

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

Translate
BKBK
Community Expert
Community Expert
Feb 13, 2015 8:59 PM UTC

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.

Translate