getPath(), conn.isSecure(), state.getCookies()); if ((cookies != null) && (cookies.length > 0)) { if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) {
public Cookie[] getCookies() { return httpState.getCookies(); }
public Cookie[] getCookies() { return httpState.getCookies(); }
/** * Updates the current cookie settings from the specified HTTP state's cookie configuration. * @param state the HTTP state to update from * @see #updateState(HttpState) */ protected synchronized void updateFromState(final HttpState state) { if (!cookiesEnabled_) { return; } cookies_.clear(); cookies_.addAll(Arrays.asList(state.getCookies())); }
/** * Updates the current cookie settings from the specified HTTP state's cookie configuration. * @param state the HTTP state to update from * @see #updateState(HttpState) */ protected synchronized void updateFromState(final HttpState state) { if (!cookiesEnabled_) { return; } cookies_.clear(); cookies_.addAll(Arrays.asList(state.getCookies())); }
/** * Updates the current cookie settings from the specified HTTP state's cookie configuration. * @param state the HTTP state to update from * @see #updateState(HttpState) */ protected synchronized void updateFromState(final HttpState state) { if (!cookiesEnabled_) { return; } cookies_.clear(); cookies_.addAll(Arrays.asList(state.getCookies())); }
public Cookie[] getCookies() { if(sessionClient == null) return null; Cookie[] cookies = sessionClient.getState().getCookies(); return cookies; }
/** * Get all the cookies */ public Cookie[] getCookies() { return client.getState().getCookies(); }
static public Cookie[] getGlobalCookies() { HttpClient client = new HttpClient(connmgr); Cookie[] cookies = client.getState().getCookies(); return cookies; }
public Cookie[] getCookies() { if (sessionClient == null) return null; Cookie[] cookies = sessionClient.getState().getCookies(); return cookies; }
/** * Returns all cookies which are stored for the given url and session. */ public Cookie[] getCookies(URL url, IRtXMASessionClient session) { Cookie[] cookies = getHttpState(session).getCookies(); if(cookies!=null&&cookies.length>0) { cookies = cookieSpec.match(url.getHost(),getPort(url),url.getPath(),"https".equals(url.getProtocol()),cookies); } return cookies; }
public String getCookiesString() { Cookie[] cookies = getState().getCookies(); String cookiesString = ""; for (Cookie cookie : cookies) { cookiesString = cookiesString + cookie.toString() + ";"; // logCookie(cookie); } return cookiesString; }
Cookie[] cookies = state.getCookies(); for (Cookie cookie : cookies){ System.out.println(" " + cookie.getName() + ": " + cookie.getValue());
@Override public void processMessageToMatchSession(HttpMessage message, WebSession session) throws UnsupportedWebSessionException { if (session.getHttpState() == null) return; session.getHttpState().purgeExpiredCookies(); // Remove any cookies that will be added by the HttpState from the message List<HttpCookie> cookies = message.getRequestHeader().getHttpCookies(); Iterator<HttpCookie> it = cookies.iterator(); while (it.hasNext()) { HttpCookie c = it.next(); for (Cookie sc : session.getHttpState().getCookies()) if (sc.getName().equals(c.getName())) { it.remove(); break; } } message.setCookies(cookies); }
/** * Look for session cookies. * * @return true if session cookies are available */ protected boolean isAuthenticated(HttpMethod method) { boolean authenticated = false; if (method.getStatusCode() == HttpStatus.SC_OK && "/ews/services.wsdl".equalsIgnoreCase(method.getPath())) { // direct EWS access returned wsdl authenticated = true; } else { // check cookies for (Cookie cookie : httpClient.getState().getCookies()) { // Exchange 2003 cookies if (cookie.getName().startsWith("cadata") || "sessionid".equals(cookie.getName()) // Exchange 2007 cookie || "UserContext".equals(cookie.getName()) // Direct EWS access || "exchangecookie".equals(cookie.getName()) ) { authenticated = true; break; } } } return authenticated; }
Cookie[] cookies = context.getHttpClient().getState().getCookies();
Cookie[] cookies = context.getHttpClient().getState().getCookies();
private void logCookiesAtState(String when) { Cookie[] cookies = getState().getCookies(); if (cookies.length == 0) { Log_OC.d(TAG + " #" + mInstanceNumber, "No cookie at STATE " + when); } else { Log_OC.d(TAG + " #" + mInstanceNumber, "Cookies at STATE (" + when + ")"); for (int i=0; i<cookies.length; i++) { Log_OC.d(TAG + " #" + mInstanceNumber, " (" + i + "):" + "\n name: " + cookies[i].getName() + "\n value: " + cookies[i].getValue() + "\n domain: " + cookies[i].getDomain() + "\n path: " + cookies[i].getPath() ); } } }
protected void checkPublicFolder() { synchronized (httpClient.getState()) { Cookie[] currentCookies = httpClient.getState().getCookies(); // check public folder access try { publicFolderUrl = httpClient.getHostConfiguration().getHostURL() + PUBLIC_ROOT; DavPropertyNameSet davPropertyNameSet = new DavPropertyNameSet(); davPropertyNameSet.add(Field.getPropertyName("displayname")); PropFindMethod propFindMethod = new PropFindMethod(publicFolderUrl, davPropertyNameSet, 0); try { DavGatewayHttpClientFacade.executeMethod(httpClient, propFindMethod); } catch (IOException e) { // workaround for NTLM authentication only on /public if (!DavGatewayHttpClientFacade.hasNTLMorNegotiate(httpClient)) { DavGatewayHttpClientFacade.addNTLM(httpClient); DavGatewayHttpClientFacade.executeMethod(httpClient, propFindMethod); } } // update public folder URI publicFolderUrl = propFindMethod.getURI().getURI(); } catch (IOException e) { // restore cookies on error httpClient.getState().addCookies(currentCookies); LOGGER.warn("Public folders not available: " + (e.getMessage() == null ? e : e.getMessage())); // default public folder path publicFolderUrl = PUBLIC_ROOT; } } }
for (Cookie cookie : httpClient.getState().getCookies()) if (cookie.getName().equals("rbsessionid")) foundSessionCookie = cookie.getValue();