SimpleSAML_Auth_State::deleteState PHP Method

deleteState() public static method

This function deletes the given state to prevent the user from reusing it later.
public static deleteState ( &$state )
    public static function deleteState(&$state)
    {
        assert('is_array($state)');
        if (!array_key_exists(self::ID, $state)) {
            // This state hasn't been saved
            return;
        }
        SimpleSAML\Logger::debug('Deleting state: ' . var_export($state[self::ID], true));
        $session = SimpleSAML_Session::getSessionFromRequest();
        $session->deleteData('SimpleSAML_Auth_State', $state[self::ID]);
    }

Usage Example

Example #1
0
 /**
  * Complete logout.
  *
  * This function should be called after logout has completed. It will never return,
  * except in the case of exceptions. Exceptions thrown from this page should not be caught,
  * but should instead be passed to the top-level exception handler.
  *
  * @param array &$state  Information about the current authentication.
  */
 public static function completeLogout(&$state)
 {
     assert('is_array($state)');
     assert('array_key_exists("LogoutCompletedHandler", $state)');
     SimpleSAML_Auth_State::deleteState($state);
     $func = $state['LogoutCompletedHandler'];
     assert('is_callable($func)');
     call_user_func($func, $state);
     assert(FALSE);
 }
All Usage Examples Of SimpleSAML_Auth_State::deleteState