Neos\Flow\Session\Session::storeAuthenticatedAccountsInfo PHP Method

storeAuthenticatedAccountsInfo() protected method

This method will check if a session has already been started, which is the case after tokens relying on a session have been authenticated: the UsernamePasswordToken does, for example, start a session in its authenticate() method. Because more than one account can be authenticated at a time, this method accepts an array of tokens instead of a single account. Note that if a session is started after tokens have been authenticated, the session will NOT be tagged with authenticated accounts.
protected storeAuthenticatedAccountsInfo ( array $tokens ) : void
$tokens array
return void
    protected function storeAuthenticatedAccountsInfo(array $tokens)
    {
        $accountProviderAndIdentifierPairs = [];
        /** @var TokenInterface $token */
        foreach ($tokens as $token) {
            $account = $token->getAccount();
            if ($token->isAuthenticated() && $account !== null) {
                $accountProviderAndIdentifierPairs[$account->getAuthenticationProviderName() . ':' . $account->getAccountIdentifier()] = true;
            }
        }
        if ($accountProviderAndIdentifierPairs !== []) {
            $this->putData('TYPO3_Flow_Security_Accounts', array_keys($accountProviderAndIdentifierPairs));
        }
    }