src/Lib/AutoLoginTrait.php
public function generateLoginToken(
        array $redirectUrl = null,
        string $expireInterval = '1 day',
        bool $addRememberMeCookie = true
    ): string {
        $data = [
            'url' => $redirectUrl,
            'timestamp' => Time::now()->toUnixString(),
            'expireInterval' => $expireInterval,
            'addRememberMeCookie' => $addRememberMeCookie
        ];
        $serializedData = serialize($data);
        $token = Security::encrypt($serializedData, $this->getKey(), $this->getSalt());

        return base64_encode($token);
    }
public function generateLoginToken(
        array $redirectUrl = null,
        string $expireInterval = '1 day',
        bool $addRememberMeCookie = true
    ): string {
        $data = [
            'url' => $redirectUrl,
            'timestamp' => Time::now()->toUnixString(),
            'expireInterval' => $expireInterval,
            'addRememberMeCookie' => $addRememberMeCookie
        ];
        $serializedData = serialize($data);
        $token = Security::encrypt($serializedData, $this->getKey(), $this->getSalt());

        return base64_encode($token);
    }
Generates a auto login token.

@param array|null $redirectUrl         Optional redirect url
@param string     $expireInterval      When this token expires
@param bool       $addRememberMeCookie Enabling setting the remember me cookie on auto login
@return string