Welcome Guest, Not a member yet? Register   Sign In
Garbage collection
#3

If you want you can set up a cron and do your own custom garbage collection based on your session settings. You don't have to rely on the built in GC mechanism. This is one example:

PHP Code:
public function ci_sessions_gc()
 
   {
 
       $this->load->database();
 
       
        $sess_expiration 
config_item('sess_expiration');
 
       $sess_save_path  config_item('sess_save_path');

 
       if$sess_expiration )
 
       {
 
           $epoch_expired time() - $sess_expiration;
 
           $this->db->where('timestamp <'$epoch_expired)
 
               ->delete$sess_save_path );
 
       }
 
   
Reply


Messages In This Thread
Garbage collection - by BABYpanda - 02-24-2018, 11:47 AM
RE: Garbage collection - by dave friend - 02-24-2018, 02:49 PM
RE: Garbage collection - by skunkbad - 02-24-2018, 04:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB