(Created page with '== Enabling sessions == It is quite possible, that you'll use session variables in the configuration file (config.cfm), for example when setting up the [[CKFinder_2.x/Developers…') |
(No difference)
|
Latest revision as of 20:21, 14 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.