src/Session.php
public static function gc()
    {
        if (\version_compare(PHP_VERSION, '7.0.0', '>=')) {
            return \session_gc();
        }
        /*
            Polyfill for PHP < 7
        */
        $initial = array(
            'status' => \session_status(),
            'probability' => \ini_get('session.gc_probability'),
            'divisor' => \ini_get('session.gc_divisor'),
        );
        if ($initial['status'] === PHP_SESSION_DISABLED) {
            return false;
        }
        if ($initial['status'] === PHP_SESSION_ACTIVE) {
            // garbage collection is performed on session_start..
            // close our open session... and restart it
            \session_write_close();
        }
        \ini_set('session.gc_probability', 1);
        \ini_set('session.gc_divisor', 1);
        \session_start();
        \ini_set('session.gc_probability', $initial['probability']);
        \ini_set('session.gc_divisor', $initial['divisor']);
        if ($initial['status'] === PHP_SESSION_NONE) {
            if (self::$status['requestId']) {
                \session_write_close();
            } else {
                \session_destroy();
            }
        }
        return true;
    }
public static function gc()
    {
        if (\version_compare(PHP_VERSION, '7.0.0', '>=')) {
            return \session_gc();
        }
        /*
            Polyfill for PHP < 7
        */
        $initial = array(
            'status' => \session_status(),
            'probability' => \ini_get('session.gc_probability'),
            'divisor' => \ini_get('session.gc_divisor'),
        );
        if ($initial['status'] === PHP_SESSION_DISABLED) {
            return false;
        }
        if ($initial['status'] === PHP_SESSION_ACTIVE) {
            // garbage collection is performed on session_start..
            // close our open session... and restart it
            \session_write_close();
        }
        \ini_set('session.gc_probability', 1);
        \ini_set('session.gc_divisor', 1);
        \session_start();
        \ini_set('session.gc_probability', $initial['probability']);
        \ini_set('session.gc_divisor', $initial['divisor']);
        if ($initial['status'] === PHP_SESSION_NONE) {
            if (self::$status['requestId']) {
                \session_write_close();
            } else {
                \session_destroy();
            }
        }
        return true;
    }
public static function gc ( ) { if ( \ version_compare ( PHP_VERSION , '7.0.0' , '>=' ) ) { return \ session_gc ( ) ; } /*
            Polyfill for PHP < 7
        */ $ initial = array ( 'status' => \ session_status ( ) , 'probability' => \ ini_get ( 'session.gc_probability' ) , 'divisor' => \ ini_get ( 'session.gc_divisor' ) , ) ; if ( $ initial [ 'status' ] === PHP_SESSION_DISABLED ) { return false ; } if ( $ initial [ 'status' ] === PHP_SESSION_ACTIVE ) { // garbage collection is performed on session_start.. // close our open session... and restart it \ session_write_close ( ) ; } \ ini_set ( 'session.gc_probability' , 1 ) ; \ ini_set ( 'session.gc_divisor' , 1 ) ; \ session_start ( ) ; \ ini_set ( 'session.gc_probability' , $ initial [ 'probability' ] ) ; \ ini_set ( 'session.gc_divisor' , $ initial [ 'divisor' ] ) ; if ( $ initial [ 'status' ] === PHP_SESSION_NONE ) { if ( self :: $ status [ 'requestId' ] ) { \ session_write_close ( ) ; } else { \ session_destroy ( ) ; } } return true ; }
Perform session data garbage collection

@return integer number of deleted sessions
Perform session data garbage collection