Skip to main content
April 15, 2010
Question

How do I store passwords for the entire application

  • April 15, 2010
  • 2 replies
  • 336 views

I am using the cfmail tag and am required to use a user name and password.  I'd like to centralize this login information in a single place to simplify the code and allow me to change the password often.  Can anyone recommend a way to do this?

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
April 15, 2010

theedryden wrote:

I am using the cfmail tag and am required to use a user name and password.  I'd like to centralize this login information in a single place to simplify the code and allow me to change the password often.  Can anyone recommend a way to do this?

You should normally store variables that are needed application-wide in application scope in the onApplicationStart method. For example,

<cfset application.adminUsername = "BKBK">

<cfset application.adminPassword = "kB43kB21">

<cfset application.datasource = "myDSN">

This occurs once only. You may then use application.adminUsername, application.adminPassword, etc., anywhere in the application.

ilssac
Inspiring
April 15, 2010

Set the user name and password for the mail server in the mail settings in the ColdFusion Administrator.

http://livedocs.adobe.com/coldfusion/8/htmldocs/basiconfig_11.html#1139855