コード例 #1
0
 /**
  * Determine whether there's an according session record to a given session_id
  * in the database. Don't care if session record is still valid or not.
  *
  * This calls the parent function but additionally tries to look up the session ID in the "fe_session_data" table.
  *
  * @param integer $id Claimed Session ID
  * @return boolean Returns TRUE if a corresponding session was found in the database
  * @todo Define visibility
  */
 public function isExistingSessionRecord($id)
 {
     // Perform check in parent function
     $count = parent::isExistingSessionRecord($id);
     // Check if there are any fe_session_data records for the session ID the client claims to have
     if ($count == FALSE) {
         $statement = $this->db->prepare_SELECTquery('content,tstamp', 'fe_session_data', 'hash = :hash');
         $res = $statement->execute(array(':hash' => $id));
         if ($res !== FALSE) {
             if ($sesDataRow = $statement->fetch()) {
                 $count = TRUE;
                 $this->sesData = unserialize($sesDataRow['content']);
                 $this->sessionDataTimestamp = $sesDataRow['tstamp'];
             }
             $statement->free();
         }
     }
     return $count;
 }
コード例 #2
0
 /**
  * Determine whether there's an according session record to a given session_id
  * in the database. Don't care if session record is still valid or not.
  *
  * This calls the parent function but additionally tries to look up the session ID in the "fe_session_data" table.
  *
  * @param int $id Claimed Session ID
  * @return bool Returns TRUE if a corresponding session was found in the database
  */
 public function isExistingSessionRecord($id)
 {
     // Perform check in parent function
     $count = parent::isExistingSessionRecord($id);
     // Check if there are any fe_session_data records for the session ID the client claims to have
     if ($count == false) {
         $sesDataRow = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('fe_session_data')->select(['content', 'tstamp'], 'fe_session_data', ['hash' => $id])->fetch();
         if ($sesDataRow !== null) {
             $count = true;
             $this->sesData = unserialize($sesDataRow['content']);
             $this->sessionDataTimestamp = $sesDataRow['tstamp'];
         }
     }
     return $count;
 }