private JSONObject getResponseFromCookie(HttpServletRequest request) {
        Map<String, String> previousIdps = new HashMap<String, String>();
        String last = "";
        Cookie[] cookies = request.getCookies();
        if (cookies != null) {
            for (Cookie cookie : cookies) {
                String name = cookie.getName();
                if (name.equals("previousIdPs")) {
                    try {
                        String decoded = Base64Coder.decodeString(cookie.getValue());
                        getCookieValues(decoded, previousIdps);
                    } catch (Exception ex) {
                        getCookieValues("", previousIdps);
                    }
                }
                if (name.equals("lastIdp")) {
                    last = cookie.getValue();
                }
            }
        }
        return getResponseJson(last, previousIdps, true, true);
    }