Welcome Guest, Not a member yet? Register   Sign In
Issue with session since upgrade to v3.1.9
#1

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?
Reply
#2

@arieccc,

What version of PHP are you using?
Reply
#3

You cannot have a null sess_save_path when using the files driver.
Reply
#4

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?
Reply
#5

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.
What did you Try? What did you Get? What did you Expect?

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

(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!
Reply
#7

(This post was last modified: 08-22-2018, 06:21 AM by arieccc.)

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.
Reply
#8

@arieccc,

If that was your solution then your problem might have been permissions on the session directory.
Reply
#9

Or his session gc_probability is set to 0
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB