multivalent.net

Class Cookies

public class Cookies extends Behavior

Implements both Netscape spec and W3C spec .

For example:

Set-cookie: RMID=3fc51f1b38b7eeb0; expires=Fri, 31-Dec-2010 23:59:59 GMT; path=/; domain=.nytimes.com

LATER: periodically save cookies, take cookie policy (none, all, ask, only from same host) from preferences.

Version: $Revision: 1.3 $ $Date: 2003/06/02 05:22:24 $

Method Summary
voiddestroy()
StringgetAll(String domain, String path)
Return all cookies matching domain and path.
voidput(String host, String namevals)
Updates existing or adds new cookie to database.
booleansemanticEventAfter(SemanticEvent se, String msg)
At semantic openedDocument, extract cookies.
booleansemanticEventBefore(SemanticEvent se, String msg)
At semantic openDocument, add stored cookies to headers.
voidwrite()

Method Detail

destroy

public void destroy()

getAll

public String getAll(String domain, String path)
Return all cookies matching domain and path. Netscape spec: "When requesting a URL from an HTTP server, the browser will match the URL against all cookies and if any of them match, a line containing the name/value pairs of all matching cookies will be included in the HTTP request."

put

public void put(String host, String namevals)
Updates existing or adds new cookie to database.

semanticEventAfter

public boolean semanticEventAfter(SemanticEvent se, String msg)
At semantic openedDocument, extract cookies.

semanticEventBefore

public boolean semanticEventBefore(SemanticEvent se, String msg)
At semantic openDocument, add stored cookies to headers.

write

public void write()