Spanner/src/Session/CacheSessionPool.php
private function purgeOrphanedInUseSessions(array &$data)
    {
        foreach ($data['inUse'] as $key => $session) {
            if ($session['lastActive'] + SessionPoolInterface::SESSION_EXPIRATION_SECONDS < $this->time()) {
                unset($data['inUse'][$key]);
            } elseif ($session['lastActive'] + self::DURATION_TWENTY_MINUTES < $this->time()) {
                unset($session['lastActive']);
                array_push($data['queue'], $session);
                unset($data['inUse'][$key]);
            }
        }
    }
private function purgeOrphanedInUseSessions(array &$data)
    {
        foreach ($data['inUse'] as $key => $session) {
            if ($session['lastActive'] + SessionPoolInterface::SESSION_EXPIRATION_SECONDS < $this->time()) {
                unset($data['inUse'][$key]);
            } elseif ($session['lastActive'] + self::DURATION_TWENTY_MINUTES < $this->time()) {
                unset($session['lastActive']);
                array_push($data['queue'], $session);
                unset($data['inUse'][$key]);
            }
        }
    }
private function purgeOrphanedInUseSessions ( array & $ data ) { foreach ( $ data [ 'inUse' ] as $ key => $ session ) { if ( $ session [ 'lastActive' ] + SessionPoolInterface :: SESSION_EXPIRATION_SECONDS < $ this -> time ( ) ) { unset ( $ data [ 'inUse' ] [ $ key ] ) ; } elseif ( $ session [ 'lastActive' ] + self :: DURATION_TWENTY_MINUTES < $ this -> time ( ) ) { unset ( $ session [ 'lastActive' ] ) ; array_push ( $ data [ 'queue' ] , $ session ) ; unset ( $ data [ 'inUse' ] [ $ key ] ) ; } } }
Purges in use sessions. If a session was last active an hour ago, we
assume it is expired and remove it from the pool. If last active 20
minutes ago, we attempt to return the session back to the queue.

@param array $data
Purges in use sessions . If a session was last active an hour ago we assume it is expired and remove it from the pool . If last active 20 minutes ago we attempt to return the session back to the queue .