<?php
defined('_VALID') or die('Restricted Access!');
function cron_core_session()
{
update_script('core_session', TRUE, FALSE);
$max_lifetime = (int) ini_get('session.gc_maxlifetime');
$max_lifetime = round($max_lifetime/60);
$cmd = 'find '.TMP_DIR.'/sessions/ -depth -mindepth 1 -maxdepth 1 -type f -mmin +'.$max_lifetime.' | xargs -r rm';
exec($cmd.' 2>/dev/null');
update_script('core_session', FALSE, TRUE);
}