Classes to support cookie handling.
See: Description
Interface Summary | |
---|---|
CookieListener | An interface for classes which can listen for cookies being rejected and the reason. |
CookieSource | This interface represents a source from which to parse out cookies. |
Class Summary | |
---|---|
Cookie | An HTTP client-side cookie. |
CookieJar | A collection of HTTP cookies, which can interact with cookie and set-cookie header values. |
CookieProperties | Controls behavior for cookies. |
Classes to support cookie handling. Supports the HTTP state mechanism. The central class of this package is the {@link com.meterware.httpunit.cookies.CookieJar}, which acts as a repository of {@link com.meterware.httpunit.cookies.Cookie} objects. There are two main ways to get cookies into the CookieJar. The first is to construct the CookieJar, passing a {@link com.meterware.httpunit.cookies.CookieSource} to its constructor. This will cause the CookieJar to parse the Set-Cookie headers from the source object. The second is to copy them from another CookieJar through use of the {@link com.meterware.httpunit.cookies.CookieJar#updateCookies updateCookies(CookieJar)} method.
The CookieJar can also produce a Cookie header to be sent as part of a request. The {@link com.meterware.httpunit.cookies.CookieJar#getCookieHeaderField} method will select any cookies that it has which can be sent to the specified URL and assemble them into an appropriate header.