Spanner/src/Session/CacheSessionPool.php
private function handleSession(array $session)
    {
        if ($this->isSessionValid($session)) {
            return $session;
        }

        $this->config['lock']->synchronize(function () use ($session) {
            $item = $this->cacheItemPool->getItem($this->cacheKey);
            $data = $item->get();
            unset($data['inUse'][$session['name']]);
            $this->cacheItemPool->save($item->set($data));
        });
    }
private function handleSession(array $session)
    {
        if ($this->isSessionValid($session)) {
            return $session;
        }

        $this->config['lock']->synchronize(function () use ($session) {
            $item = $this->cacheItemPool->getItem($this->cacheKey);
            $data = $item->get();
            unset($data['inUse'][$session['name']]);
            $this->cacheItemPool->save($item->set($data));
        });
    }
private function handleSession ( array $ session ) { if ( $ this -> isSessionValid ( $ session ) ) { return $ session ; } $ this -> config [ 'lock' ] -> synchronize ( function ( ) use ( $ session ) { $ item = $ this -> cacheItemPool -> getItem ( $ this -> cacheKey ) ; $ data = $ item -> get ( ) ; unset ( $ data [ 'inUse' ] [ $ session [ 'name' ] ] ) ; $ this -> cacheItemPool -> save ( $ item -> set ( $ data ) ) ; } ) ; }
If the session is valid, return it - otherwise remove from the in use
list.

@param array $session
@return array|null
If the session is valid return it - otherwise remove from the in use list .