示例#1
0
 /**
  * Validate session
  *
  * @param SessionManagerInterface $session
  * @return void
  * @throws Exception
  */
 public function validate(SessionManagerInterface $session)
 {
     if (!isset($_SESSION[self::VALIDATOR_KEY])) {
         $_SESSION[self::VALIDATOR_KEY] = $this->_getSessionEnvironment();
     } else {
         if (!$this->_validate()) {
             $session->destroy(array('clear_storage' => false));
             // throw core session exception
             throw new Exception('');
         }
     }
 }
示例#2
0
 /**
  * Validate session
  *
  * @param SessionManagerInterface $session
  * @return void
  * @throws Exception
  */
 public function validate(SessionManagerInterface $session)
 {
     if (!isset($_SESSION[self::VALIDATOR_KEY])) {
         $_SESSION[self::VALIDATOR_KEY] = $this->_getSessionEnvironment();
     } else {
         try {
             $this->_validate();
         } catch (Exception $e) {
             $session->destroy(['clear_storage' => false]);
             // throw core session exception
             throw $e;
         }
     }
 }