You are here

public static function Cleaner::cleanerSessionsClear in Cleaner 7

Sessions clearing handler.

2 calls to Cleaner::cleanerSessionsClear()
cleaner_cleaner_run in ./cleaner.module
Implements hook_cleaner_run().
hook_cleaner_run in ./cleaner.api.php
Cleaner execution hook.

File

./class.Cleaner.php, line 160
Cleaner base class file.

Class

Cleaner
Class Cleaner.

Code

public static function cleanerSessionsClear() {
  $cookie = session_get_cookie_params();
  $count = db_delete('sessions')
    ->condition('timestamp', REQUEST_TIME - $cookie['lifetime'], '<')
    ->execute();
  if ($count) {
    self::cleanerLog('Cleared @count sessions by Cleaner.', array(
      '@count' => $count,
    ));
  }
}