Welcome Guest, Not a member yet? Register   Sign In
Remove files the sessions
#1

Hello,

About removing files in the folder sessions? How is it done automatically? Here it is not working. The sessions folder is big.

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_sessions';
$config['sess_expiration'] = 2000;
$config['sess_expire_on_close'] = FALSE;
$config['sess_save_path'] = FCPATH.'application/sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

Thanks.
Reply
#2

Copying/pasting from http://forum.codeigniter.com/thread-6356...#pid325590

PHP should automatically cleanup old sessions (regardless of which driver you use) based on the settings session.gc_probability, session.gc_divisor, and session.gc_maxlifetime, usually set in php.ini (but it can be set elsewhere, if needed).

Some Linux installations (especially Debian-based distributions like Ubuntu) set these variables so the built-in garbage collector won't run, then add their own cron job to do it every 30 minutes or so. The only problem with that is that you probably aren't using the default location for session data, so you would have to either change the settings or create your own cron job to perform the garbage collection.
Reply
#3

I use Ubuntu. How do I create cron job? I have no idea.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB