Welcome Guest, Not a member yet? Register   Sign In
Sessions not deleting
#1

(This post was last modified: 12-01-2018, 09:20 AM by coolerkid9090.)

My session files are not automatically being deleted. I have a client facing website that uses sessions with logins and a REST API that uses Codeigniter. The API doesn’t use any session data, but I think a session still gets started automatically. 

My session files are building up in: /var/cpanel/php/sessions/ea-php55

That directory gets up to 30 gigabytes in size. Why is it growing so large and why isn’t it cleaning on its own? 

These are my session settings:

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = ‘mysession';
$config['sess_expiration'] = (60 * 60); 
$config['sess_save_path'] = FCPATH . "sessions";
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = TRUE;

Any ideas? 
Reply
#2

(This post was last modified: 12-01-2018, 02:47 PM by dave friend.)

Does your CodeIgniter installation start at /var/cpanel/php/ ? Or, stated a different way, is the main CodeIgniter file index.php found in the /var/cpane/php/ folder?
Reply
#3

Also check your php.ini settings for sessions

Code:
session.gc_probability = 1

session.gc_divisor = 1000

session.gc_maxlifetime = 1440

Those are default values.

if gc_probability = 0 it will never delete the session files.
What did you Try? What did you Get? What did you Expect?

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

It's in the public_html folder. 

(12-01-2018, 02:46 PM)dave friend Wrote: Does your CodeIgniter installation start at /var/cpanel/php/ ? Or, stated a different way, is the main CodeIgniter file index.php found in the /var/cpane/php/ folder?
Reply
#5

(12-01-2018, 02:52 PM)InsiteFX Wrote: Also check your php.ini settings for sessions

Code:
session.gc_probability = 1

session.gc_divisor = 1000

session.gc_maxlifetime = 1440

Those are default values.

if gc_probability = 0 it will never delete the session files.

I already had those set like you posted.
Reply
#6

What version of CI are you using? Pretty sure at some point they fixed something to do with sessions on CI3.
Reply
#7

(12-03-2018, 06:00 PM)coolerkid9090 Wrote: It's in the public_html folder. 

(12-01-2018, 02:46 PM)dave friend Wrote: Does your CodeIgniter installation start at /var/cpanel/php/ ? Or, stated a different way, is the main CodeIgniter file index.php found in the /var/cpane/php/ folder?

Sorry if I was not clear, but what I'm asking for is the full path to the public_html folder.

The reason I ask is that your statement:
Quote:...session files are building up in: /var/cpanel/php/sessions/ea-php55
begs the question of whether the path /var/cpanel/php/ leads to the public_html folder - or not.  If it does not, then all those session fles belong to cpanel and not to CodeIgniter.
Reply
#8

(12-04-2018, 02:08 AM)Pertti Wrote: What version of CI are you using? Pretty sure at some point they fixed something to do with sessions on CI3.

I'm using 3.1.5
Reply
#9

(12-04-2018, 09:17 AM)dave friend Wrote:
(12-03-2018, 06:00 PM)coolerkid9090 Wrote: It's in the public_html folder. 

(12-01-2018, 02:46 PM)dave friend Wrote: Does your CodeIgniter installation start at /var/cpanel/php/ ? Or, stated a different way, is the main CodeIgniter file index.php found in the /var/cpane/php/ folder?

Sorry if I was not clear, but what I'm asking for is the full path to the public_html folder.

The reason I ask is that your statement:
Quote:...session files are building up in: /var/cpanel/php/sessions/ea-php55
begs the question of whether the path /var/cpanel/php/ leads to the public_html folder - or not.  If it does not, then all those session fles belong to cpanel and not to CodeIgniter.

The full path is: /home/user/public_html
Is that what you mean? If not, how do I find the info you are looking for? 

Thanks!!
Reply
#10

(12-04-2018, 12:24 PM)coolerkid9090 Wrote: The full path is: /home/user/public_html
Is that what you mean? If not, how do I find the info you are looking for? 

If that is where the CodeIgniter "index.php" file is found then, yes that's what I was looking for.

Because you use this to define where session files are saved
PHP Code:
$config['sess_save_path'] = FCPATH "sessions"
we know that the CodeIgniter session files are at  /home/user/public_html/sessions/

So, that makes me reasonably confident that the session files building up in /var/cpanel/php/sessions/ea-php55 are related to cpanel.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB