Lines Matching defs:cookie

2  * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/RFC2965PortAttributeHandler.java $
32 package org.apache.http.impl.cookie;
36 import org.apache.http.cookie.ClientCookie;
37 import org.apache.http.cookie.Cookie;
38 import org.apache.http.cookie.CookieAttributeHandler;
39 import org.apache.http.cookie.CookieOrigin;
40 import org.apache.http.cookie.MalformedCookieException;
41 import org.apache.http.cookie.SetCookie;
42 import org.apache.http.cookie.SetCookie2;
45 * <tt>"Port"</tt> cookie attribute handler for RFC 2965 cookie spec.
91 * @param port port of host where cookie was received from or being sent to.
108 * Parse cookie port attribute.
110 public void parse(final SetCookie cookie, final String portValue)
112 if (cookie == null) {
115 if (cookie instanceof SetCookie2) {
116 SetCookie2 cookie2 = (SetCookie2) cookie;
125 * Validate cookie port attribute. If the Port attribute was specified
126 * in header, the request port must be in cookie's port list.
128 public void validate(final Cookie cookie, final CookieOrigin origin)
130 if (cookie == null) {
137 if (cookie instanceof ClientCookie
138 && ((ClientCookie) cookie).containsAttribute(ClientCookie.PORT_ATTR)) {
139 if (!portMatch(port, cookie.getPorts())) {
142 + "Request port not found in cookie's port list.");
148 * Match cookie port attribute. If the Port attribute is not specified
149 * in header, the cookie can be sent to any port. Otherwise, the request port
150 * must be in the cookie's port list.
152 public boolean match(final Cookie cookie, final CookieOrigin origin) {
153 if (cookie == null) {
160 if (cookie instanceof ClientCookie
161 && ((ClientCookie) cookie).containsAttribute(ClientCookie.PORT_ATTR)) {
162 if (cookie.getPorts() == null) {
163 // Invalid cookie state: port not specified
166 if (!portMatch(port, cookie.getPorts())) {