CodeIgniter Forums
Help : Message: ini_set(): A session is active. You cannot change the session module' - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Help : Message: ini_set(): A session is active. You cannot change the session module' (/showthread.php?tid=64901)



Help : Message: ini_set(): A session is active. You cannot change the session module' - Jorus35 - 04-09-2016

Hi there,

How are you ?

I really need your help, I am pretty sure I am going to get nuts with that... Yesterday, I've decided to upgrade an old CI2 to CI3. Everything went fine at the beginning, but now I am getting this messages each I am trying to load any URL :


Quote:A PHP Error was encountered
Severity: Warning
Message: ini_set(): A session is active. You cannot change the session module's ini settings at this time
Filename: Session/Session.php
Line Number: 313

A PHP Error was encountered
Severity: Notice
Message: A session had already been started - ignoring session_start()
Filename: Session/Session.php
Line Number: 140

A PHP Error was encountered
Severity: Warning
Message: ini_set(): A session is active. You cannot change the session module's ini settings at this time
Filename: Session/Session.php
Line Number: 313

A PHP Error was encountered
Severity: Notice
Message: A session had already been started - ignoring session_start()
Filename: Session/Session.php
Line Number: 140


Here are some information regarding my project :

The Controller Accueil.php :
Code:
<?php

class Accueil extends Front_Controller {

   public function __construct()
    {
       parent::__construct();
       $this->load->model('Accueil_model');
   
   }

   public function index()
    {
        $this->load->helper('form');
       $this->load->helper('text');
       $data['testimonials'] = $this->Accueil_model->get_testimonials($limit = 3);
       $data = $this->Accueil_model->get_recently_trip_list($limit = 10, $data);
        // echo '<pre>';print_r($data);echo'</pre>';exit;
        // echo CI_VERSION;
       $this->load->view('home', $data);
        // echo 'Hello World';
   }

}

?>


I've ran a lot of test and the only way to remove all these messages is to remove the line parent::__construct();

I've checked into the MY_Controller.php file and I didn't saw a thing... I've even ran a test removing the My_Controller.php and using CI_Controller instead of Front_Controller... But the result was exactly the same.

On a php side session.auto_start is set to 0.

For information, I am using a database session driver, but this is the exact same with files.

Does any one could help me ?


RE: Help : Message: ini_set(): A session is active. You cannot change the session module' - InsiteFX - 04-09-2016

Make sure you delete the complete system directory then install the new.


RE: Help : Message: ini_set(): A session is active. You cannot change the session module' - allenlee - 05-20-2016

You must placed session_start() in somewhere before you load session library $this->load->library('session');

Search your custom code to find it


RE: Help : Message: ini_set(): A session is active. You cannot change the session module' - rolly - 03-03-2018

Set $config['sess_save_path']


RE: Help : Message: ini_set(): A session is active. You cannot change the session module' - dave friend - 03-03-2018

(05-20-2016, 09:29 AM)allenlee Wrote: You must placed session_start() in somewhere before you load session library $this->load->library('session');

This is not true. When the 'session' library is loaded, a call to session_start() will be made at the appropriate time.


RE: Help : Message: ini_set(): A session is active. You cannot change the session module' - Narf - 03-09-2018

(03-03-2018, 11:12 AM)dave friend Wrote:
(05-20-2016, 09:29 AM)allenlee Wrote: You must placed session_start() in somewhere before you load session library $this->load->library('session');

This is not true. When the 'session' library is loaded, a call to session_start() will be made at the appropriate time.

@allenlee meant to say "You must have placed session_start() ..." and is correct.