Examples of Cookie


Examples of org.asynchttpclient.cookie.Cookie

            h.add("Test2", "Test2");
            h.add("Test3", "Test3");
            h.add("Test4", "Test4");
            h.add("Test5", "Test5");

            final Cookie coo = Cookie.newValidCookie("foo", "value", "value", "/", "/", -1L, -1, false, false);
            client.prepareGet(getTargetUrl()).setHeaders(h).addCookie(coo).execute(new AsyncCompletionHandlerAdapter() {

                @Override
                public Response onCompleted(Response response) throws Exception {
                    try {
View Full Code Here

Examples of org.cometd.client.transport.HttpClientTransport.Cookie

          String path = null;
          int maxAge = -1;
          boolean secure = false;
          int version = 0;
          String comment = null;
          cookieProvider.setCookie(new Cookie(name, value, domain, path, maxAge, secure, version, comment));
        }
      }
    }
  }
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.core.Cookie

    }
  }

  public Object inject(HttpRequest request)
  {
    Cookie cookie = request.getHttpHeaders().getCookies().get(paramName);
    if (rawType.equals(Cookie.class))
    {
      return cookie;
    }

    if (cookie == null)
    {
      return extractValue(null);
    }
    return extractValue(cookie.getValue());
  }
View Full Code Here

Examples of org.glassfish.grizzly.http.Cookie

            //There is no Cookie header in request so generate a new JSESSIONID  or
            //failover has occured in which case you can generate a new JSESSIONID
            sessionId = createSessionId();
        }
        StringBuilder sb = new StringBuilder();
        final Cookie cookie = new Cookie(SESSION_COOKIE_NAME, sessionId);
        cookie.setMaxAge(MAX_AGE);
        cookie.setPath(ASADMIN_PATH);
        cookie.setVersion(1);
        CookieSerializerUtils.serializeServerCookie(sb, true, false, cookie);
        return sb.toString();

    }
View Full Code Here

Examples of org.htmlparser.http.Cookie

     */
    public void setCookie (Cookie cookie, String domain)
    {
        String path;
        Vector cookies;
        Cookie probe;

        if (null != cookie.getDomain ())
            domain = cookie.getDomain ();
        path = cookie.getPath ();
        if (null == mCookieJar)
            mCookieJar = new Hashtable (); // turn on cookie processing
        cookies = (Vector)mCookieJar.get (domain);
        if (null != cookies)
        {
          boolean found = false;
            for (int j = 0; j < cookies.size (); j++)
            {
                probe = (Cookie)cookies.elementAt (j);
                if (probe.getName ().equalsIgnoreCase (cookie.getName ()))
                {
                    // we keep paths sorted most specific to least
                    if (probe.getPath ().equals (path))
                    {
                        cookies.setElementAt (cookie, j); // replace
                        found = true;
                        break;
                    }
                    else if (path.startsWith (probe.getPath ()))
                    {
                        cookies.insertElementAt (cookie, j);
                        found = true;
                        break;
                    }
View Full Code Here

Examples of org.jboss.arquillian.ajocado.cookie.Cookie

    }

    @Override
    public Cookie getCookieByName(String cookieName) {
        String value = selenium.getCookieByName(cookieName);
        return new Cookie(cookieName, value);
    }
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.Cookie

      //destroy the session.
      if (sessionId == null) {
        return;
      }
      CookieEncoder cookieEncoder = new CookieEncoder(true);
      Cookie cookie = new DefaultCookie(SESSION, "deleted");
      cookie.setMaxAge(0);
      cookieEncoder.addCookie(cookie);
          controller.getResponse().setHeader(HttpHeaders.Names.SET_COOKIE, cookieEncoder.encode());
          this.getSessionPersistence(controller).deleteSession(sessionId);
      return;
    }
   
   
    if (sessionId == null && !controller.getSessionStorage().isEmpty()) {
      CookieEncoder cookieEncoder = new CookieEncoder(true);
      sessionId = UUID.randomUUID().toString();
      Cookie cookie = new DefaultCookie(SESSION, sessionId);
      cookie.setMaxAge(this.maxAge);
      cookieEncoder.addCookie(cookie);
          controller.getResponse().setHeader(HttpHeaders.Names.SET_COOKIE, cookieEncoder.encode());
    }
    //save the session.
    controller.getSessionStorage().put("expires", IsoDateUtil.getIsoDate(new Date(new Date().getTime()+(1000*this.maxAge))));
 
View Full Code Here

Examples of org.jogger.http.Cookie

    when( cs.getPriority() ).thenReturn(1000);

    RoutingEngine routingEngine = getSpringContext().getBean(RoutingEngine.class);
    when(routingEngine.getConnections()).thenReturn( Collections.singletonList(cs) );

    MockResponse response = get("/connections").addCookie(new Cookie("access_token", "true")).run();

    Assert.assertEquals( response.getStatus(), Response.OK );

    JSONArray jsonResponse = new JSONArray( response.getOutputAsString() );
    Assert.assertNotNull( jsonResponse );
View Full Code Here

Examples of org.jwall.web.policy.Cookie

            s.append("</html>");
            return this;
        }

        if( arg1.getType() == TreeNode.COOKIE_NODE ){
            Cookie c = (Cookie) arg1;

            StringBuffer s = new StringBuffer("<html>Cookie: <b>" + c.getName() + "</b>");
            s.append(", Regexp: <b>" + c.getRegexp() + "</b>" );
            if( c.isRequired() )
                s.append(", Required: <b>" + c.isRequired() + "</b>");

            s.append("</html>");
            setText( s.toString() );
            setIcon( WebPolicyEditor.getIcon( c ) );
            return this;
View Full Code Here

Examples of org.mockserver.model.Cookie

        assertThat(httpResponse.getHeaders(), containsInAnyOrder(
                new Header("header_name", "header_value"),
                new Header("Set-Cookie", "cookie_name=cookie_value")
        ));
        assertEquals(httpResponse.getCookies(), Arrays.asList(
                new Cookie("cookie_name", "cookie_value")
        ));
        assertEquals(httpResponse.getBodyAsString(), "some_other_body");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.