Package javax.servlet.http

Examples of javax.servlet.http.Cookie


  
   public void testDomain() throws Exception
   {
      AbstractJBossManager mgr = getManager(getContext(CONTEXT_PATH, null, null, DOMAIN, false, false));
     
      Cookie cookie = validateResponse(executeRequest(mgr, false));
      validateCookie(cookie, CONTEXT_PATH, null, DOMAIN, false, false);
   }
View Full Code Here


  
   public void testCookiePath() throws Exception
   {
      AbstractJBossManager mgr = getManager(getContext(CONTEXT_PATH, ROOT_PATH, null, null, false, false));
     
      Cookie cookie = validateResponse(executeRequest(mgr, false));
      validateCookie(cookie, ROOT_PATH, false);
   }
View Full Code Here

  
   public void testComment() throws Exception
   {
      AbstractJBossManager mgr = getManager(getContext(CONTEXT_PATH, null, COMMENT, null, false, false));
     
      Cookie cookie = validateResponse(executeRequest(mgr, false));
      validateCookie(cookie, CONTEXT_PATH, COMMENT, null, false, false);
   }
View Full Code Here

  
   public void testSecureContext() throws Exception
   {
      AbstractJBossManager mgr = getManager(getContext(CONTEXT_PATH, null, null, null, false, true));
     
      Cookie cookie = validateResponse(executeRequest(mgr, false));
      validateCookie(cookie, CONTEXT_PATH, true);
   }
View Full Code Here

  
   public void testHttpOnly() throws Exception
   {
      AbstractJBossManager mgr = getManager(getContext(CONTEXT_PATH, null, null, null, true, false));
     
      Cookie cookie = validateResponse(executeRequest(mgr, false));
      validateCookie(cookie, CONTEXT_PATH, null, null, true, false);
   }
View Full Code Here

       // for DIGEST and SSL authenticated contexts)
       String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
       if (ssoId == null) {
           // Construct a cookie to be returned to the client
           ssoId = generateSessionId();
           Cookie cookie = new Cookie(Constants.SINGLE_SIGN_ON_COOKIE, ssoId);
           cookie.setMaxAge(-1);
           cookie.setPath("/");
          
           // Bugzilla 41217
           cookie.setSecure(request.isSecure());
          
           // Bugzilla 34724
           String ssoDomain = sso.getCookieDomain();
           if(ssoDomain != null) {
               cookie.setDomain(ssoDomain);
           }

           response.addCookie(cookie);

           // Register this principal with our SSO valve
View Full Code Here

     */
    private void saveRequest(Request request, Session session) {

        // Create and populate a SavedRequest object for this request
        SavedRequest saved = new SavedRequest();
        Cookie cookies[] = request.getCookies();
        if (cookies != null) {
            for (int i = 0; i < cookies.length; i++)
                saved.addCookie(cookies[i]);
        }
        Enumeration names = request.getHeaderNames();
View Full Code Here

    */
   protected String getCookieValue(Cookie[] cookies, int numCookies, String token)
   {
      for (int i = 0; i < numCookies; i++)
      {
         Cookie cookie = cookies[i];
         log.trace("Matching cookieToken:" + token + " with cookie name=" + cookie.getName());
         if (token.equals(cookie.getName()))
         {
            if (trace)
               log.trace("Cookie-" + token + " value=" + cookie.getValue());
            return cookie.getValue();
         }
      }
      return null;
   }
View Full Code Here

      String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
      if (ssoId == null)
      {
         // Construct a cookie to be returned to the client
         ssoId = generateSessionId();
         Cookie cookie = new Cookie(Constants.SINGLE_SIGN_ON_COOKIE, ssoId);
         cookie.setMaxAge(-1);
         cookie.setPath("/");

         // Bugzilla 41217
         cookie.setSecure(request.isSecure());

         // Bugzilla 34724
         String ssoDomain = sso.getCookieDomain();
         if (ssoDomain != null)
         {
            cookie.setDomain(ssoDomain);
         }

         Response response = ActiveRequestResponseCacheValve.activeResponse.get();
         response.addCookie(cookie);
View Full Code Here

               sessionCookieValue = null;
            }
         }
         else
         {
            Cookie c;
            inCookies.addElement(c = new Cookie(name, value));
            if (path != null)
            {
               c.setPath(path);
               if (domain != null)
                  c.setDomain(domain);
            }
         }
      }
View Full Code Here

TOP

Related Classes of javax.servlet.http.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.