Line 1: | Line 1: | ||
== Enabling sessions == | == Enabling sessions == | ||
− | It is quite possible, that you'll use session variables in the configuration file (config.cfm), for example when setting up the [[ | + | It is quite possible, that you'll use session variables in the configuration file (config.cfm), for example when setting up the [[CKFinder_1.x/Developers_Guide/ColdFusion/Configuration/Access_Control|Access Control]] or writing the [[CKFinder_1.x/Developers_Guide/ColdFusion/Configuration/Quick_Start|CheckAuthentication]] function. |
Please remember that you have to enable session management in your application before use of session variables becomes available. | Please remember that you have to enable session management in your application before use of session variables becomes available. |
Latest revision as of 08:25, 28 May 2010
Enabling sessions
It is quite possible, that you'll use session variables in the configuration file (config.cfm), for example when setting up the Access Control or writing the CheckAuthentication function.
Please remember that you have to enable session management in your application before use of session variables becomes available.
- In ColdFusion 6.1, create the Application.cfm file and place it in the ckfinder folder:
<cfapplication Name = "CKFinder_Connector" SessionManagement = true ApplicationTimeout = "#CreateTimeSpan( 0, 0, 5, 0 )#" SessionTimeout = "#CreateTimeSpan(0,0,45,0)#" SetClientCookies = true >
- If you are running ColdFusion 7 (or later), create a similar Application.cfc file and place it in the ckfinder folder:
<cfcomponent displayname="Application" output="false" hint="Pre-page processing for the application"> <cfscript> THIS.Name = "CKFinder_Connector"; THIS.ApplicationTimeout = "#CreateTimeSpan( 0, 0, 5, 0 )#"; THIS.SessionTimeout = "#CreateTimeSpan(0,0,45,0)#"; THIS.SessionManagement = true; THIS.SetClientCookies = true; </cfscript> </cfcomponent>
Because each Application has its own unique session scope, you will probably have to modify the name of the application in the initialization files. Open:
-
ckfinder/Application.cfc
-
ckfinder/core/connector/cfm/Application.cfc
and adjust THIS.Name
variable, you should use the same name that your main application uses.
After you have enabled session variables using sessionManagement
, you can start using them in your code (and in configuration file):
<cfset SESSION.CKFinder_UserRole = "admin">
Note: session variables can be disabled globally in the ColdFusion Administrator. In such case, you will not be able to use session variables, regardless of what you set the sessionManagement attribute to.
More information about session handling can be found in the ColdFusion documentation.