CodeIgniter Forums
What causes session loss on staging server? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: What causes session loss on staging server? (/showthread.php?tid=87985)



What causes session loss on staging server? - AndrewLittle - 07-03-2023

The staging server, running on PHP 7.4, is experiencing an issue with the session after logging in and redirecting to the home page. The session becomes lost or null.

The system utilizes CodeIgniter (CI) 3.0.6, with the configuration setting $config['sess_driver'] = 'database';.

It's worth mentioning that I can successfully log in and redirect without any problems on my local server (PHP 7.4) and the production server (PHP 7.0).

To address the issue, I have attempted two solutions:

Updating the php.ini file by changing session.auto_start from 0 to 1.
Modifying the CI Session.php file by replacing ini_set('session.name', $params['cookie_name']); with ini_set('session.id', $params['cookie_name']);.
Unfortunately, neither of these solutions has resolved the problem. Furthermore, it has been discovered that the ci_sessions table in the database does not have any data being inserted into it.


RE: What causes session loss on staging server? - kenjis - 07-03-2023

I recommend you use at least the latest version of CI3. That is v3.1.13.