CookieJar
Simple robust cookie library
Exports
CookieAccessInfo(domain,path,secure,script)
class to determine matching qualities of a cookieProperties
- String domain - domain to match
- String path - path to match
- Boolean secure - access is secure (ssl generally)
- Boolean script - access is from a script
Cookie(cookiestrorcookie, requestdomain, requestpath)
It turns input into a Cookie (singleton if given a Cookie), therequest_domain
argument is used to default the domain if it is not explicit in the cookie string,
the request_path
argument is used to set the path if it is not explicit in a cookie String.Explicit domains/paths will cascade, implied domains/paths must exactly match (see http://en.wikipedia.org/wiki/HTTPcookie#DomainandPat).
Properties
- String name - name of the cookie
- String value - string associated with the cookie
- String domain - domain to match (on a cookie a '.' at the start means a wildcard matching anything ending in the rest)
- Boolean explicitdomain - if the domain was explicitly set via the cookie string
- String path - base path to match (matches any path starting with this '/' is root)
- Boolean explicit
Methods
String toString()
- the set-cookie: string for this cookieString toValueString()
- the cookie: string for this cookieCookie parse(cookiestr, request_domain, request_path)
- parses the string onto this cookie or a new one if called directlyBoolean matches(access_info)
- returns true if the accessinfo allows retrieval of this cookieBoolean collidesWith(cookie)
- returns true if the cookies cannot exist in the same space (domain and path match)
CookieJar()
class to hold numerous cookies from multiple domains correctlyMethods
Cookie setCookie(cookie, request_domain, request_path)
- modify (or add if not already-existing) a cookie to the jarCookie[] setCookies(cookiestr_or_list, request_domain, request_path)
- modify (or add if not already-existing) a large number of cookies to the jarCookie getCookie(cookie_name,access_info)
- get a cookie with the name and accessinfo matchingCookie[] getCookies(access_info)
- grab all cookies matching this accessinfo