Lines Matching refs:cookie

41  * policy decisions on cookie acceptance/rejection.
43 * <p> The HTTP cookie management in java.net package looks like:
65 * CookieHandler is at the core of cookie management. User can call
71 * or not one cookie should be accepted and put into cookie store. User can use
77 * CookieStore is the place where any accepted HTTP cookie is stored in.
90 * <p>There're various ways user can hook up his own HTTP cookie management behavior, e.g.
131 * Create a new cookie manager.
133 * <p>This constructor will create new cookie manager with default
134 * cookie store and accept policy. The effect is same as
143 * Create a new cookie manager with specified cookie store and cookie policy.
145 * @param store a <tt>CookieStore</tt> to be used by cookie manager.
146 * if <tt>null</tt>, cookie manager will use a default one,
149 * to be used by cookie manager as policy callback.
156 // use default cookie policy if not specify one
172 * To set the cookie policy of this cookie manager.
175 * cookie policy ACCEPT_ORIGINAL_SERVER by default. Users always
176 * can call this method to set another cookie policy.
178 * @param cookiePolicy the cookie policy. Can be <tt>null</tt>, which
179 * has no effects on current cookie policy.
187 * To retrieve current cookie store.
189 * @return the cookie store currently used by cookie manager.
207 // if there's no default CookieStore, no way for us to get any cookie
214 for (HttpCookie cookie : cookieJar.get(uri)) {
218 if (pathMatches(uri, cookie) &&
219 (secureLink || !cookie.getSecure())) {
222 String ports = cookie.getPortlist();
229 cookies.add(cookie);
232 cookies.add(cookie);
258 // if there's no default CookieStore, no need to remember any cookie
284 logger.severe("Invalid cookie for " + uri + ": " + headerValue);
287 for (HttpCookie cookie : cookies) {
288 if (cookie.getPath() == null) {
300 cookie.setPath(path);
303 if (!pathMatches(uri, cookie)) {
312 if (cookie.getDomain() == null) {
313 cookie.setDomain(uri.getHost());
315 String ports = cookie.getPortlist();
324 cookie.setPortlist("" + port );
325 if (shouldAcceptInternal(uri, cookie)) {
326 cookieJar.add(uri, cookie);
333 shouldAcceptInternal(uri, cookie)) {
334 cookieJar.add(uri, cookie);
338 if (shouldAcceptInternal(uri, cookie)) {
339 cookieJar.add(uri, cookie);
344 // invalid set-cookie header string
354 // to determine whether or not accept this cookie
355 private boolean shouldAcceptInternal(URI uri, HttpCookie cookie) {
357 return policyCallback.shouldAccept(uri, cookie);
391 * Return true iff. the path from {@code cookie} matches the path from {@code uri}.
393 private static boolean pathMatches(URI uri, HttpCookie cookie) {
394 return normalizePath(uri.getPath()).startsWith(normalizePath(cookie.getPath()));
419 // Netscape cookie spec and RFC 2965 have different format of Cookie
424 for (HttpCookie cookie : cookies) {
425 if (cookie.getVersion() < minVersion) {
426 minVersion = cookie.getVersion();