CodeIgniter Forums
session problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: session problem (/thread-72319.html)



session problem - bibash bagh - 12-04-2018

hi i'm using ci-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.


RE: session problem - php_rocs - 12-04-2018

@bibash bagh,

Why don't you just autoload it (/config/autoload.php section auto-load libraries [ https://codeigniter.com/user_guide/libraries/sessions.html?highlight=auto%20load%20session#using-the-session-class ] ) and it will always be available. This way all you have to do is reference it.