When working on a ColdFusion site and using Dreamweaver's Log In User server behavior, you may experience one of the following problems or errors with your login page:
|
Whenever you try to use the login page in a web browser, login always fails, even for username/password combinations that are legitimate. |
|
The error below occurs when attempting to use the login page in a web browser: Error Occurred While Processing Request Error Diagnostic Information An error occurred while evaluating the expression: // username and password match - this is a valid user Error near line 19, column 7. Note: This feature may have been disabled by the site administrator. The error occurred while processing an element with a general identifier of (CFSCRIPT), occupying document position (17:5) to (17:14). |
|
The error below occurs when attempting to use the login page in a web browser: Error Occurred While Processing Request Error Diagnostic Information Cannot lock session scope CFLock cannot be used to lock the application or session shared scopes without these scopes being established through the use of the CFApplication tag. You must use CFApplication and specify an application name to use the application scope. If you want to use the session scope you need to enable session management as well. Application and/or Session variables must also be enabled in the ColdFusion Administrator. The error occurred while processing an element with a general identifier of (CFLOCK), occupying document position (10:7) to (10:60). |
The variant of the problem that occurs depends on which version of ColdFusion server you are using and whether you have selected Dreamweaver MX or UltraDev 4 code model for the login page.
The problems and errors above appear when attempting to use session variables in ColdFusion pages without enabling session variables in the Application.cfm file. These session variable errors can occur with pages that were created with Dreamweaver's Log In User server behavior, because the Log In User server behavior utilizes session variables.
TheApplication.cfm file is not automatically created by Dreamweaver when implementing the Log In User server behavior because an Application.cfm file may already exist for the web application. If Dreamweaver automatically created an Application.cfm file, then any user-created Application.cfm file (which could contain numerous settings for application and client scope variables) would be replaced by a Dreamweaver-generated Application.cfm file containing only session scope variables. To avoid the possibility of overwriting an existing file and deleting information, theApplication.cfm file is not automatically created by Dreamweaver.
In order to use Dreamweaver's Log In User server behavior, you must enable session management for the application by doing the following things:
|
Create a file called Application.cfm, if it does not already exist. ColdFusion looks for this file first in the same directory as the calling page, then travels up the directory tree until it finds an Application.cfm file. Note:On UNIX systems, filenames are case sensitive. The Application.cfm file name needs to spelled with a capital A. |
|
At minimum, the following code should be placed in the Application.cfm file. If this page already exists, make sure that "sessionmanagement" is set to"yes". Please refer to the ColdFusion documentation for otherApplication.cfm settings. <CFAPPLICATION NAME="Name" SESSIONMANAGEMENT="Yes" > |
|
Upload the Application.cfm file to the remote server. |
Additional information
For more details on using session variables, please see How to create a session variable (TechNote 16563).
For tips relating to passing form data from a page with the Log In User server behavior, please refer to: How to pass a user name from a login page (TechNote 15398).

