php - Session are lost after redirect in CodeIgniter 3

in this link:

https://php.developreference.com/article/23484402/Codeigniter+session+data+lost+after+redirect

if you are working in CI 3.x and just upgraded your server php version to php 7.x Go to system/libraries/Session/session.php at Line no 281 and replace ini_set('session.name', $params['cookie_name']); by ini_set('session.id', $params['cookie_name']);


Go to

system/libraries/Session/session.php

at Line no 281 and replace

ini_set('session.name', $params['cookie_name']); 

by

ini_set('session.id', $params['cookie_name']);

This problem occurs normally while upgrading PHP later version to 7.3 +


also check your php.ini file for this option:

session.auto_start=1