Erase the credentials

@return bool
552432
public function clear()
    {
        if (!$this->credentials) {
            $this->credentials = new Credentials;
        }

        $this->credentials->forget();

        return true;
    }
1328306
public function delete()
    {
        $userService = $this->getServiceLocator()->get(tao_models_classes_UserService::class);
        // Csrf token validation
        $tokenService = $this->getServiceLocator()->get(TokenService::SERVICE_ID);
        $tokenName = $tokenService->getTokenName();
        $token = $this->getRequestParameter($tokenName);
        if (! $tokenService->checkToken($token)) {
            $this->logWarning('Xsrf validation failed');
            $this->returnJson([
                'success' => false,
                'message' => 'Not authorized to perform action'
            ]);
            return;
        } else {
            $tokenService->revokeToken($token);
            $newToken = $tokenService->createToken();
            $this->setCookie($tokenName, $newToken, null, '/');
        }

        $deleted = false;
        $message = __('An error occurred during user deletion');
        if (ApplicationHelper::isDemo()) {
            $message = __('User deletion not permitted on a demo instance');
        } elseif ($this->hasRequestParameter('uri')) {
            $user = $this->getResource(tao_helpers_Uri::decode($this->getRequestParameter('uri')));
            $this->checkUser($user->getUri());

            if ($userService->removeUser($user)) {
                $deleted = true;
                $message = __('User deleted successfully');
            }
        }
        $this->returnJson(array(
            'success' => $deleted,
            'message' => $message
        ));
    }
1222397
public static function logout()
  {
    $storage = Remember::$storage;
    $rememberMe = Remember::$rememberMe;

    $storage->cleanAllTriplets(isset($_SESSION['_uas']) ? $_SESSION['_uas'] : '');

    $_SESSION = [];

    session_regenerate_id();
    $rememberMe->clearCookie();

    return (object)array('status' => 'success');
  }
444139
public function logout()
    {

        // load the user identity and the subject's principals
        $identity = $this->getIdentity();
        $principals = $this->subject->getPrincipals();

        // remove the user identity from the subject
        foreach ($principals as $key => $principal) {
            if ($identity->equals($principal)) {
                $principals->remove($key);
            }
        }

        // return TRUE on success
        return true;
    }
1063098
public function delete()
    {
        $queryKeys = $this->prepareKeys(false);

        if (count($queryKeys) > 0) {
            return $this->redClient->del($queryKeys);
        }

        return false;
    }
950824
private function destroyOldSessions()
    {
        $sql = $this->safesql->query("UPDATE `login`
                SET valid = 0
                WHERE user='%s'
                AND deleted = 0
                AND session_name='%s'
                AND logged_in=0
                OR TIMESTAMPDIFF(SECOND,timestamp,NOW()) > %i",
                array($this->getUser(),
                        SESSION_NAME,
                        SESSION_LENGTH));

        return $this->db->query($sql);
    }
626230
public function clear()
    {
        $cachePath   = $this->options['path'];
        $cachePrefix = $this->options['prefix'] ? $this->options['prefix'].DIRECTORY_SEPARATOR : '';
        $files       = (array) glob($cachePath.$cachePrefix.'*');

        foreach ($files as $file) {
            if (is_dir($file)) {
                $matches = glob($file.'/*.php');
                if (is_array($matches)) {
                    array_map('unlink', $matches);
                }
                rmdir($file);
            } else {
                $this->unlink($file);
            }
        }

        return true;
    }
698298
public function isCredentialsNonExpired()
    {
        if (true === $this->credentialsExpired) {
            return false;
        }

        if (null !== $this->credentialsExpireAt && $this->credentialsExpireAt->getTimestamp() < time()) {
            return false;
        }

        return true;
    }
387329
public static function clearSession(){
        session_destroy();
        self::$instance->invalidate();
        setcookie(self::$instance->getName(), self::$instance->getId(), time() - 3600 ,'/');
        return true;
    }
467910
public function revokeSession()
    {
        try {
            // Only show this flash if there are users in the system.
            // Not when we're about to get redirected to the "first users" screen.
            if ($this->getRepositoryUsers()->count() > 0) {
                $this->flashLogger->info(Trans::__('general.phrase.access-denied-logged-out'));
            }
        } catch (TableNotFoundException $e) {
            // If we have no table, then we definitely have no users
        }

        // Remove all auth tokens when logging off a user
        if ($sessionAuth = $this->session->get('authentication')) {
            try {
                $this->getRepositoryAuthtoken()->deleteTokens($sessionAuth->getUser()->getId());
            } catch (TableNotFoundException $e) {
                // Database tables have been dropped
            } catch (InvalidFieldNameException $e) {
                // Database tables need updating
            } catch (DriverException $e) {
                // Database tables need updating
            }
        }

        $this->session->remove('authentication');
        $this->session->migrate(true, 0);

        return false;
    }
466691
def clear_credentials():
    """"""
    global identity, regions, services, cloudservers, cloudfiles, cloud_cdn
    global cloud_loadbalancers, cloud_databases, cloud_blockstorage, cloud_dns
    global cloud_networks, cloud_monitoring, autoscale, images, queues
    identity = None
    regions = tuple()
    services = tuple()
    cloudservers = None
    cloudfiles = None
    cloud_cdn = None
    cloud_loadbalancers = None
    cloud_databases = None
    cloud_blockstorage = None
    cloud_dns = None
    cloud_networks = None
    cloud_monitoring = None
    autoscale = None
    images = None
    queues = None
1056936
public function clear()
    {
        $keys = eaccelerator_list_keys();
        if (is_array($keys)) {
            foreach ($keys as $info) {
                // eaccelerator bug (Http://eaccelerator.net/ticket/287)
                if (0 === strpos($info['name'], ':')) {
                    $key = substr($info['name'], 1);
                } else {
                    $key = $info['name'];
                }

                if (!eaccelerator_rm($key)) {
                    return false;
                }
            }
        }

        return true;
    }
1033584
public function clearCookie()
    {

        $triplet = Triplet::fromString($this->cookie->getValue());

        $this->cookie->deleteCookie();

        if (!$triplet->isValid()) {
            return false;
        }

        $this->storage->cleanTriplet($triplet->getCredential(), $triplet->getSaltedPersistentToken($this->salt));

        return true;
    }
229433
public boolean logout() {
    subject.getPrincipals().removeAll(principals);
    subject.getPrivateCredentials().removeAll(privateCredentials);
    subject.getPublicCredentials().removeAll(publicCredentials);
    principals.clear();
    privateCredentials.clear();
    publicCredentials.clear();
    return true;
  }
274679
public function clearLoginData()
    {
        //  Clear the session
        $oSession = Factory::service('Session', 'nails/module-auth');
        $oSession->unsetUserData('id');
        $oSession->unsetUserData('email');
        $oSession->unsetUserData('group_id');

        //  Set the flag
        $this->bIsLoggedIn = false;

        //  Reset the activeUser
        $this->clearActiveUser();

        //  Remove any remember me cookie
        $this->clearRememberCookie();
    }
1017008
protected function forgetFormatted()
    {
        if ($this->files->exists($compiled_path = $this->config['compiled_path'])) {
            return $this->files->delete($compiled_path);
        }

        return false;
    }
1001689
public void clearCredentials() {
        storage.remove(KEY_ACCESS_TOKEN);
        storage.remove(KEY_REFRESH_TOKEN);
        storage.remove(KEY_ID_TOKEN);
        storage.remove(KEY_TOKEN_TYPE);
        storage.remove(KEY_EXPIRES_AT);
        storage.remove(KEY_SCOPE);
    }