Sessions"

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

(New page: == Enabling sessions == It is quite possible, that you'll use session variables in the configuration file (config.php), for example when setting up the [[CKFinder/Developers_Guide/PHP/Con...)
 
(Enabling sessions)
Line 3: Line 3:
 
It is quite possible, that you'll use session variables in the configuration file (config.php), for example when setting up the [[CKFinder/Developers_Guide/PHP/Configuration/Access_Control|Access Control]] or writing the [[CKFinder/Developers_Guide/PHP/Configuration/Quick_Start|CheckAuthentication()]] function.  
 
It is quite possible, that you'll use session variables in the configuration file (config.php), for example when setting up the [[CKFinder/Developers_Guide/PHP/Configuration/Access_Control|Access Control]] or writing the [[CKFinder/Developers_Guide/PHP/Configuration/Quick_Start|CheckAuthentication()]] function.  
  
Be sure that you have started your session before use of $_SESSION becomes available.
+
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:
 
In most cases it can be done by uncommenting the "session_start()" call in the configuration file:
 
<pre>
 
<pre>
 
session_start();
 
session_start();
 +
</pre>
 +
 +
Once enabled, session variables cab be accessed using the global $_SESSION array:
 +
<pre>
 +
$_SESSION['CKFinder_UserRole'] = "admin";
 
</pre>
 
</pre>
  
  
 
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].

Revision as of 09:07, 16 February 2008

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 cab be accessed using the global $_SESSION array:

$_SESSION['CKFinder_UserRole'] = "admin";


More information about session handling can be found in PHP manual.