Home » Php » PHP Codeigniter Session error: Message: session_cache_limiter(): Cannot change cache limiter when session is active

PHP Codeigniter Session error: Message: session_cache_limiter(): Cannot change cache limiter when session is active

Posted by: admin February 25, 2020 Leave a comment

Questions:

php -v:7.3.11

codeigniter -v:3.0.3

A PHP Error was encountered
Severity: Warning

Message: session_cache_limiter(): Cannot change cache limiter when session is active

Filename: core/MY_Controller.php

Line Number: 24

Backtrace:

File: G:\xamp\htdocs\sales_pro\a\site\application\core\MY_Controller.php
Line: 24
Function: session_cache_limiter

File: G:\xamp\htdocs\sales_pro\a\site\application\controllers\admin\Login.php
Line: 16
Function: __construct

File: G:\xamp\htdocs\sales_pro\a\site\index.php
Line: 309
Function: require_once

I tried commenting out the following lines in system/libraries/session/session.php
but not working

session_start()
ini_set('session.use_trans_sid', 0);
ini_set('session.use_strict_mode', 1);
ini_set('session.use_cookies', 1);
ini_set('session.use_only_cookies', 1);
ini_set('session.hash_function', 1);
ini_set('session.hash_bits_per_character', 4);

I also tried

 if(!isset($_SESSION)){
        session_start();
 }
How to&Answers:

swithched codeigniter version to 3.1… And the issue solved