在一个控制器中初始化会话后,我无法使用另一个控制器的会话ID,也无法在不同的页面中使用它

version 3.19 and i am having problem in session .

sceneraio:

i have loaded session libraray in config folder and controller.

 public function __construct() 
{
          parent::__construct();
             $this->load->library('session'); 
                                 $this->load->model('product_model');

 }

problem: after initialising session in one controller i am n't able use the session id for another controller and nor i am able to use it in different page.

As you want a session to be created if the user is logged in, or not then why not use the autoloader (./application/config/autoload.php)?

$autoload['libraries'] = array('session');