Skip to content
Advertisement

access codeigniter session values from external files

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 external files ?

Advertisement

Answer

<?php
    ob_start();
    include('index.php');
    ob_end_clean();
    $CI =& get_instance();
    $CI->load->library('session'); //if it's not autoloaded in your CI setup
    echo $CI->session->userdata('name');
?>
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement