/** * Obtain the session cookie from the request * * @param request * * @return */ protected String getSessionCookie(Request request) { Cookie[] cookies = request.getCookies(); log.trace("Cookies:" + cookies); int numCookies = cookies != null ? cookies.length : 0; // We can have comma-separated ids String ids = sessionCookieForSSOAuth; if (ids == null || ids.length() == 0) { throw new IllegalStateException("Session cookies configuration in tomcat service missing"); } StringTokenizer st = new StringTokenizer(ids, ","); while (st.hasMoreTokens()) { String cookieToken = st.nextToken(); String val = getCookieValue(cookies, numCookies, cookieToken); if (val != null) { return val; } } if (log.isTraceEnabled()) { log.trace("Session Cookie not found"); } return null; }
/** * Obtain the session cookie from the request * * @param request * * @return */ protected String getSessionCookie(Request request) { Cookie[] cookies = request.getCookies(); log.trace("Cookies:" + cookies); int numCookies = cookies != null ? cookies.length : 0; // We can have comma-separated ids String ids = sessionCookieForSSOAuth; if (ids == null || ids.length() == 0) { throw new IllegalStateException("Session cookies configuration in tomcat service missing"); } StringTokenizer st = new StringTokenizer(ids, ","); while (st.hasMoreTokens()) { String cookieToken = st.nextToken(); String val = getCookieValue(cookies, numCookies, cookieToken); if (val != null) { return val; } } if (log.isTraceEnabled()) { log.trace("Session Cookie not found"); } return null; }
/** * Obtain the session cookie from the request * * @param request * * @return */ protected String getSessionCookie(Request request) { Cookie[] cookies = request.getCookies(); log.trace("Cookies:" + cookies); int numCookies = cookies != null ? cookies.length : 0; // We can have comma-separated ids String ids = sessionCookieForSSOAuth; if (ids == null || ids.length() == 0) { throw new IllegalStateException("Session cookies configuration in tomcat service missing"); } StringTokenizer st = new StringTokenizer(ids, ","); while (st.hasMoreTokens()) { String cookieToken = st.nextToken(); String val = getCookieValue(cookies, numCookies, cookieToken); if (val != null) { return val; } } if (log.isTraceEnabled()) { log.trace("Session Cookie not found"); } return null; }