gnu.inet.http

Class SimpleCookieManager

Implemented Interfaces:
CookieManager

public class SimpleCookieManager
extends java.lang.Object
implements CookieManager

A simple non-persistent cookie manager. This class can be extended to provide cookie persistence.

Author:
Chris Burdess

Field Summary

protected Map
cookies
The cookie cache.

Constructor Summary

SimpleCookieManager()
Constructor.

Method Summary

Cookie[]
getCookies(String host, boolean secure, String path)
Retrieves the cookies matching the specified criteria.
void
setCookie(Cookie cookie)
Stores a cookie in the cookie manager.

Field Details

cookies

protected Map cookies
The cookie cache. This is a dictionary mapping domains to maps of cookies by name.

Constructor Details

SimpleCookieManager

public SimpleCookieManager()
Constructor.

Method Details

getCookies

public Cookie[] getCookies(String host,
                           boolean secure,
                           String path)
Retrieves the cookies matching the specified criteria.
Specified by:
getCookies in interface CookieManager

Parameters:
host - the host name
secure - whether the connection is secure
path - the path to access


setCookie

public void setCookie(Cookie cookie)
Stores a cookie in the cookie manager.
Specified by:
setCookie in interface CookieManager

Parameters:
cookie - the cookie to store


© Copyright 2003 The Free Software Foundation, all rights reserved