CodeIgniter Forums

Full Version: Issue with session since upgrade to v3.1.9
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I notice issues with the session since I upgraded to v3.1.9.

This is the issue:

Severity: Warning --> session_start(): Failed to decode session object. Session has been destroyed /CI_APP/system/libraries/Session/Session.php 143

These are my session settings: 

$config['sess_driver'] = 'files';

$config['sess_cookie_name'] = 'tp_session';

$config['sess_expiration'] = SESSION_DURATION;

$config['sess_save_path'] = null;

$config['sess_match_ip'] = false;

$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = false;

Anyone else having this issue as well?
@arieccc,

What version of PHP are you using?
You cannot have a null sess_save_path when using the files driver.
Thanks for your replies guys!

I am using PHP 7.1.20

I thought sess_save_path set to NULL would CI use the default session storage path, but I will check into this. 

The session is working normally, but at random moments I am being kicked out of the session and get the error as mentioned in my earlier post. 
I recall CI 2.x has same issues with this as well, ajax call killing the session and locking issues. 

Any ideas?
If your using ajax then you need to do a call session_write_close() once you no longer need anything to do with session variables.
(08-03-2018, 02:23 AM)arieccc Wrote: [ -> ]I thought sess_save_path set to NULL would CI use the default session storage path, but I will check into this. 

From the Sessions Variables section of config.php

Quote:| 'sess_save_path'
 |
 | The location to save sessions to, driver dependent.
 |
 | For the 'files' driver, it's a path to a writable directory.
 | WARNING: Only absolute paths are supported!

 |
 | IMPORTANT: You are REQUIRED to set a valid save path!
Thanks for your replies!

The session files were saved correctly. But issue remained. I tried to reduce size of each session (amount of data stored in the serialized session object). I reduced it from 8 kB to <1 kB. Didn't help.
It is still a mystery to me why this issue occurs, but changing the session driver to database fixed my issue. So I will stick to that solution for now.
@arieccc,

If that was your solution then your problem might have been permissions on the session directory.
Or his session gc_probability is set to 0