Welcome Guest, Not a member yet? Register   Sign In
ini_set(): A session is active
#1

Code:
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: 282

My system : 
PHP 7.3.11 on Mac OS Catalina

After upgrading from CI 2.2.1 to 3.1.11 version I keep getting these Warnings, I have no session_start() calls in my code, if I set ENVIRONMENT = production the warnings stop, I need to keep ENVIRONMENT = development to test the app but I can't remove these warnings from sessions.

My Session config:
PHP Code:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'credsession';
$config['sess_expiration'] = 0;
$config['sess_save_path'] = sys_get_temp_dir();
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE

I tried commenting session_start() on line 143 of "system/libraries/Session/Session.php" and the warnings stop, but I don't think that's a good solution.
I removed the system folder and pasted the system 3.1.11 version into my app, followed all upgrading instructions on https://www.codeigniter.com/userguide3/i...e_300.html 

Could this be a php 7.3.11 problem?
Reply
#2

Do you load the session library multiple times? If you need it everywhere you should only use the autoload.
Reply
#3

(06-01-2020, 01:58 PM)jreklund Wrote: Do you load the session library multiple times? If you need it everywhere you should only use the autoload.

No, only 'autoload'
Reply
#4

Did you replace the complete session folder under system?

Either that or like @jrelund is stating is that you are starting the session in another place
in your code.
What did you Try? What did you Get? What did you Expect?

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

Yes, I removed the system folder and replaced with the 3.1.11 folder after that, I'm not calling session_start() anywhere else in my project, as I said, I only call session in 'autoload' file
Reply
#6

Create a MY_Controller and extend the Home Controller from the MY_Controller.

Take the session out of autoload and load it in the MY_Controller and see if
the problem changes. I' am just trying to see if the problem has to do with
the session being autoloaded.
What did you Try? What did you Get? What did you Expect?

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

(06-02-2020, 04:38 AM)fabianoc Wrote: I'm not calling session_start() session_start() else in my project, as I said, I only call session in 'autoload' file

"anywhere else"??? Meaning that you do explicitly call session_start()?
Reply
#8

No, I don't
There's no call in the whole project
Reply
#9

(This post was last modified: 06-03-2020, 06:02 AM by dave friend.)

(06-02-2020, 02:58 PM)fabianoc Wrote: No, I don't
There's no call in the whole project
Good to know.

But you do load session in application/config/autoload.php using a call something like this?

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

(There may be other items in the array, but that is not important.)
Reply
#10

Exactly! That's the only place I load Session Lib

$autoload['libraries'] = array('database', 'session', 'table'');
Reply




Theme © iAndrew 2016 - Forum software by © MyBB