Jasny\SSO\Broker::attach PHP Метод

attach() публичный Метод

Attach our session to the user's session on the SSO server.
public attach ( string | true $returnUrl = null )
$returnUrl string | true The URL the client should be returned to after attaching
    public function attach($returnUrl = null)
    {
        if ($this->isAttached()) {
            return;
        }
        if ($returnUrl === true) {
            $protocol = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://';
            $returnUrl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
        }
        $params = ['return_url' => $returnUrl];
        $url = $this->getAttachUrl($params);
        header("Location: {$url}", true, 307);
        echo "You're redirected to <a href='{$url}'>{$url}</a>";
        exit;
    }