destroy() public method

Explicitly destroys all session data
public destroy ( string $reason = null ) : void
$reason string A reason for destroying the session – used by the LoggingAspect
return void
 /**
  * Logout all active authentication tokens
  *
  * @return void
  */
 public function logout()
 {
     if ($this->isAuthenticated() !== true) {
         return;
     }
     $this->isAuthenticated = null;
     /** @var $token TokenInterface */
     foreach ($this->securityContext->getAuthenticationTokens() as $token) {
         $token->setAuthenticationStatus(TokenInterface::NO_CREDENTIALS_GIVEN);
     }
     $this->emitLoggedOut();
     if ($this->session->isStarted()) {
         $this->session->destroy('Logout through AuthenticationProviderManager');
     }
     $this->securityContext->refreshTokens();
 }