Home | History | Annotate | Download | only in cookie

Lines Matching refs:cookie

2  * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/RFC2965DomainAttributeHandler.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;
44 * <tt>"Domain"</tt> cookie attribute handler for RFC 2965 cookie spec.
57 * Parse cookie domain attribute.
59 public void parse(final SetCookie cookie, String domain)
61 if (cookie == null) {
62 throw new IllegalArgumentException("Cookie may not be null");
81 cookie.setDomain(domain);
95 * @param host host name where cookie is received from or being sent to.
96 * @param domain The cookie domain attribute.
107 * Validate cookie domain attribute.
109 public void validate(final Cookie cookie, final CookieOrigin origin)
111 if (cookie == null) {
112 throw new IllegalArgumentException("Cookie may not be null");
115 throw new IllegalArgumentException("Cookie origin may not be null");
118 if (cookie.getDomain() == null) {
119 throw new MalformedCookieException("Invalid cookie state: " +
122 String cookieDomain = cookie.getDomain().toLowerCase(Locale.ENGLISH);
124 if (cookie instanceof ClientCookie
125 && ((ClientCookie) cookie).containsAttribute(ClientCookie.DOMAIN_ATTR)) {
129 cookie.getDomain() + "\" violates RFC 2109: domain must start with a dot");
138 "Domain attribute \"" + cookie.getDomain()
146 "Domain attribute \"" + cookie.getDomain()
156 + cookie.getDomain() + "\" violates RFC 2965: "
162 if (!cookie.getDomain().equals(host)) {
164 + cookie.getDomain() + "\"."
172 * Match cookie domain attribute.
174 public boolean match(final Cookie cookie, final CookieOrigin origin) {
175 if (cookie == null) {
176 throw new IllegalArgumentException("Cookie may not be null");
179 throw new IllegalArgumentException("Cookie origin may not be null");
182 String cookieDomain = cookie.getDomain();
185 // attribute of the cookie.