protected function _setRedirectUrl(ServerRequest $request)
    {
        $request->getSession()->delete('SocialAuth.redirectUrl');

        $redirectUrl = $request->getQuery(static::QUERY_STRING_REDIRECT);
        if (empty($redirectUrl)
            || substr($redirectUrl, 0, 1) !== '/'
            || substr($redirectUrl, 0, 2) === '//'
        ) {
            return;
        }

        $request->getSession()->write('SocialAuth.redirectUrl', $redirectUrl);
    }