示例#1
0
 /**
  * Update Superglobal Session and Database Session.
  *
  * @return SessionInterface The current instance
  *
  * @api
  */
 public function startSession() : SessionInterface
 {
     $this->startOurStandardPhpSession();
     header('Refresh: ' . (int) $this->getProperty('phpAutoLogoutTime') . '; url=' . $this->getProperty('redirectLogoutAuto'));
     $this->isString($this->getProperty('adusername')) ?: $this->requestRoute($this->getProperty('redirectLogout') . '/missing-adusername/');
     if ($this->sessionManager->has('passport/token')) {
         $data = $this->dbh->isSessionTokenAvailable($this->getPassport('token'))->getRecords();
         1 === $data['record_count'] ? $this->updateSessionTimestamp() : $this->unsetPassport('destination_relay')->unsetPassport('token')->requestRoute($this->getProperty('redirectLogoutShib') . '/database_session_missing/');
         /* No database session token exists: Make the user sign-in again. */
     } else {
         $this->buildNewTokenFormShibbolethADUsername()->createUserPassport($this->authentication->getProperty('email'))->requestRoute($this->getPassport('destination_relay'));
     }
     return $this;
 }