code: protected function handlePostMessage($messageName, $lastResponse, $messageOptions, $result)
      {
          if ($messageName === "Security_Authenticate") {
              $this->sessionData = $this->getSessionDataFromHeader($lastResponse);
              $this->isAuthenticated = (!empty($this->sessionData['sessionId']) &&
                  !empty($this->sessionData['sequenceNumber']) &&
                  !empty($this->sessionData['securityToken']));
          }
      }
docs: Handles post message actions
  
  Handles session state based on received response
  
  @param string $messageName
  @param string $lastResponse
  @param array $messageOptions
  @param mixed $result