class LoginHintHook implements AuthorizeRequestHook, TokenRequestHook {

    @Override
    public void afterAuthorizeSuccess(OAuth2Request o2request, Request request, Response response) {
        // If we're still in the original authorize request, stop setting the cookie in the response
        Series<CookieSetting> cookiesSetInThisResponse = response.getCookieSettings();
        CookieSetting loginHintCookieSetting = cookiesSetInThisResponse.getFirst(LOGIN_HINT_COOKIE);
        if (loginHintCookieSetting != null && loginHintCookieSetting.getMaxAge() != 0) {
            cookiesSetInThisResponse.removeFirst(LOGIN_HINT_COOKIE);
        }
        removeCookie(request, response);
    }

}