You are here

public function MongoDbSessionHandler::read in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php \Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler::read()

File

vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php, line 155

Class

MongoDbSessionHandler
MongoDB session handler.

Namespace

Symfony\Component\HttpFoundation\Session\Storage\Handler

Code

public function read($sessionId) {
  $dbData = $this
    ->getCollection()
    ->findOne(array(
    $this->options['id_field'] => $sessionId,
    $this->options['expiry_field'] => array(
      '$gte' => new \MongoDate(),
    ),
  ));
  return null === $dbData ? '' : $dbData[$this->options['data_field']]->bin;
}