code: private String getCustomReloginErrorPage(HttpServletRequest req) {
          String reLogin = CookieHelper.getCookieValue(req.getCookies(), ReferrerURLCookieHandler.CUSTOM_RELOGIN_URL_COOKIENAME);
          if (reLogin != null && reLogin.length() > 0) {
              if (reLogin.indexOf("?") < 0)
                  reLogin += "?error=error";
          }
          return reLogin;
      }
docs: Get custom error page that specified in the custom login page
  
  @param req
  @return