Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.Cookie


      HttpState state = httpConn.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if( k.getName().equalsIgnoreCase("JSESSIONID") )
            sessionID = k.getValue();
      }
      getLog().debug("Saw JSESSIONID="+sessionID);

      // Submit the login form
      GetMethod indexGet = new GetMethod(baseURLNoAuth+path);
View Full Code Here


      return attr;
   }
  
   protected String getSessionID(HttpClient client, String server)
   {
      Cookie sessionID = getSessionCookie(client, server);
      return sessionID.getValue();
   }
View Full Code Here

      return sessionID.getValue();
   }
  
   protected Cookie getSessionCookie(HttpClient client, String server)
   {
      Cookie sessionID = SessionTestUtil.getSessionCookie(client);
      if(sessionID == null)
      {
         fail("setCookieDomainToThisServer(): fail to find session id. Server name: " +server);
      }
      log.info("Saw JSESSIONID="+sessionID);
View Full Code Here

      HttpState state = httpConn.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if( k.getName().equalsIgnoreCase("JSESSIONID") )
            sessionID = k.getValue();
      }
      getLog().debug("Saw JSESSIONID="+sessionID);

      // Submit the login form
      PostMethod formPost = new PostMethod(baseURLNoAuth+"jaspi-web-form/j_security_check");
View Full Code Here

      HttpState state = httpConn.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if( k.getName().equalsIgnoreCase("JSESSIONID") )
            sessionID = k.getValue();
      }
      getLog().debug("Saw JSESSIONID="+sessionID);

      // Submit the login form
      PostMethod formPost = new PostMethod(baseURLNoAuth+"jaspi-web-form/j_security_check");
View Full Code Here

      HttpState state = httpConn.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for (int c = 0; c < cookies.length; c++)
      {
         Cookie k = cookies[c];
         if (k.getName().equalsIgnoreCase("JSESSIONID"))
            sessionID = k.getValue();
      }
      getLog().debug("Saw JSESSIONID=" + sessionID);
      // Submit the login form
      PostMethod formPost = new PostMethod(baseURLNoAuth + "custom-principal/j_security_check");
      formPost.addRequestHeader("Referer", baseURLNoAuth + "custom-principal/login.jsp");
View Full Code Here

   {
      // Get the state for the JSESSIONID
      HttpState state = client.getState();
      // Get the JSESSIONID so we can reset the host
      Cookie[] cookies = state.getCookies();
      Cookie sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if(k.getName().equalsIgnoreCase("JSESSIONID"))
         {
            sessionID = k;
         }
      }
      return sessionID;
View Full Code Here

   }

   public static void setCookieDomainToThisServer(HttpClient client, String server)
   {
      // Get the session cookie
      Cookie sessionID = getSessionCookie(client);
      if (sessionID == null)
      {
         throw new IllegalStateException("No session cookie found on " + client);
      }
      // Reset the domain so that the cookie will be sent to server1
      sessionID.setDomain(server);
      client.getState().addCookie(sessionID);
   }
View Full Code Here

      HttpState state = client.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if( k.getName().equalsIgnoreCase("JSESSIONID") )
            sessionID = k.getValue();
      }
      log.debug("Saw JSESSIONID="+sessionID);

      // Submit the login form
      PostMethod formPost = new PostMethod(baseURL0_ + securityCheckUrl_);
View Full Code Here

         {
            ssoID = cookies[c].getValue();
            if (serverA.equals(serverB) == false)
            {
               // Make an sso cookie to send to serverB
               Cookie copy = copyCookie(cookies[c], serverB);
               state.addCookie(copy);
            }
         }
      }
     
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.Cookie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.