access codeigniter session values from external files

前端 未结 7 2306
深忆病人
深忆病人 2020-12-06 07:28

In my codeigniter project i have added KCK finder.

it needs some of session values which is controlled by codeigniter. how can i access CI session values from extern

7条回答
  •  一个人的身影
    2020-12-06 08:16

    As more cleaning of '@Ben Swinburne' answer:

    1. Copy the CI index.php file and rename it (i.e. index_for_external_app.php).

    2. Open the new PHP file (index_for_external_app.php) and then edit the following variables to the external path:

      -$application_folder  
      -$system_path  
      [i.e. $system_path = '../../system';]  
      
    3. Call the created PHP file from your external system

      //include the CI index file within ob_start to prevent display other html
      ob_start();
      require('../../index_for_external_app.php');///You should edit this path
      ob_end_clean();
      
      //print the session variable for testing
      echo '
      ';
      print_r($_SESSION);
      echo '
      ';

提交回复
热议问题