/**
  * Before execute login
  *
  * @param Login $login
  * @return void
  */
 public function beforeExecute(Login $login)
 {
     $logoutReasonCode = $this->securityCookieHelper->getLogoutReasonCookie();
     if ($this->isLoginForm($login) && $logoutReasonCode >= 0) {
         $this->messageManager->addError($this->sessionsManager->getLogoutReasonMessageByStatus($logoutReasonCode));
         $this->securityCookieHelper->deleteLogoutReasonCookie();
     }
 }
 /**
  * Test delete logout reason cookie
  * @return void
  */
 public function testDeleteLogoutReasonCookie()
 {
     $frontName = 'FrontName';
     $this->createCookieMetaData();
     $this->backendDataMock->expects($this->once())->method('getAreaFrontName')->willReturn($frontName);
     $this->cookieMetadataMock->expects($this->once())->method('setPath')->with('/' . $frontName)->willReturnSelf();
     $this->cookieMetadataMock->expects($this->once())->method('setDuration')->with(-1)->willReturnSelf();
     $this->phpCookieManagerMock->expects($this->once())->method('setPublicCookie')->with(\Magento\Security\Helper\SecurityCookie::LOGOUT_REASON_CODE_COOKIE_NAME, '', $this->cookieMetadataMock)->willReturnSelf();
     $this->assertEquals($this->helper, $this->helper->deleteLogoutReasonCookie());
 }