Welcome Guest, Not a member yet? Register   Sign In
Help : Message: ini_set(): A session is active. You cannot change the session module'
#1

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 ?
Reply
#2

Make sure you delete the complete system directory then install the new.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

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

Search your custom code to find it
Personal blog: https://terryl.in
My personal project is called Dictpedia is currently using Codeigniter 3, welcome.
Reply
#4

Set $config['sess_save_path']
Reply
#5

(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.
Reply
#6

(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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB