(→Enabling sessions) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Enabling sessions == | == Enabling sessions == | ||
− | It is quite possible, that you'll use session variables in the configuration file (config.php), for example when setting up the [[ | + | It is quite possible, that you'll use session variables in the configuration file (config.php), for example when setting up the [[CKFinder_1.x/Developers_Guide/PHP/Configuration/Access_Control|Access Control]] or writing the [[CKFinder_1.x/Developers_Guide/PHP/Configuration/Quick_Start|CheckAuthentication()]] function. |
Please remember that you have to start your session before use of $_SESSION becomes available. | Please remember that you have to start your session before use of $_SESSION becomes available. | ||
Line 14: | Line 14: | ||
</pre> | </pre> | ||
− | Please do not call session_start() in the [[ | + | Please do not call session_start() in the [[CKFinder_1.x/Developers_Guide/PHP/Configuration/Quick_Start|CheckAuthentication()]] function body, it is recommended to call session_start() at the beginning of config.php instead. |
More information about session handling can be found in [http://php.net/manual/en/ref.session.php PHP manual]. | More information about session handling can be found in [http://php.net/manual/en/ref.session.php PHP manual]. |
Latest revision as of 08:11, 28 May 2010
Enabling sessions
It is quite possible, that you'll use session variables in the configuration file (config.php), for example when setting up the Access Control or writing the CheckAuthentication() function.
Please remember that you have to start your session before use of $_SESSION becomes available. In most cases it can be done by uncommenting the "session_start()" call in the configuration file:
session_start();
Once enabled, session variables can be accessed using the global $_SESSION array:
$_SESSION['CKFinder_UserRole'] = "admin";
Please do not call session_start() in the CheckAuthentication() function body, it is recommended to call session_start() at the beginning of config.php instead.
More information about session handling can be found in PHP manual.