org.apache.jmeter.protocol.http.control

## Class HC4CookieHandler

- java.lang.Object
- - org.apache.jmeter.protocol.http.control.HC4CookieHandler

- All Implemented Interfaces:
    CookieHandler

      public class HC4CookieHandler
      extends java.lang.Object
      implements CookieHandler

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_POLICY_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HC4CookieHandler()` Default constructor that uses `DEFAULT_POLICY_NAME`
    `HC4CookieHandler(java.lang.String policy)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCookieFromHeader(CookieManager cookieManager, boolean checkCookies, java.lang.String cookieHeader, java.net.URL url)` Add cookie to CookieManager from cookieHeader and URL
    `java.lang.String` | `getCookieHeaderForURL(CollectionProperty cookiesCP, java.net.URL url, boolean allowVariableCookie)` Find cookies applicable to the given URL and build the Cookie header from them.
    `java.lang.String` | `getDefaultPolicy()`
    `java.lang.String[]` | `getPolicies()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_POLICY_NAME

          public static final java.lang.String DEFAULT_POLICY_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HC4CookieHandler

          public HC4CookieHandler()

      Default constructor that uses `DEFAULT_POLICY_NAME`

    - #### HC4CookieHandler

          public HC4CookieHandler(java.lang.String policy)

  - ### Method Detail

    - #### addCookieFromHeader

          public void addCookieFromHeader(CookieManager cookieManager,
                                          boolean checkCookies,
                                          java.lang.String cookieHeader,
                                          java.net.URL url)

      Description copied from interface: `CookieHandler`
      Add cookie to CookieManager from cookieHeader and URL
      Specified by:
        `addCookieFromHeader` in interface `CookieHandler`
      Parameters:
        `cookieManager` - CookieManager on which cookies are added
        `checkCookies` - boolean to indicate if cookies must be validated against spec
        `cookieHeader` - String cookie Header
        `url` - URL

    - #### getCookieHeaderForURL

          public java.lang.String getCookieHeaderForURL(CollectionProperty cookiesCP,
                                                        java.net.URL url,
                                                        boolean allowVariableCookie)

      Description copied from interface: `CookieHandler`
      Find cookies applicable to the given URL and build the Cookie header from them.
      Specified by:
        `getCookieHeaderForURL` in interface `CookieHandler`
      Parameters:
        `cookiesCP` - `CollectionProperty` of `Cookie`
        `url` - URL of the request to which the returned header will be added.
        `allowVariableCookie` - flag whether to allow jmeter variables in cookie values
      Returns:
        the value string for the cookie header (goes after "Cookie: ") or null if no cookie matches

    - #### getDefaultPolicy

          public java.lang.String getDefaultPolicy()

      Specified by:
        `getDefaultPolicy` in interface `CookieHandler`
      Returns:
        Cookie default policy name

    - #### getPolicies

          public java.lang.String[] getPolicies()

      Specified by:
        `getPolicies` in interface `CookieHandler`
      Returns:
        Supported cookie policies

Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.