std/cookiejar
On this page
Index
- type
Entry - type
JarState - type
Jar- method
Jar.set_cookies - method
Jar.cookies - method
Jar.clear
- method
- fn
new
Types
Entry
struct Entry {
name: Str
value: Str
quoted: Bool
domain: Str
path: Str
secure: Bool
persistent: Bool
host_only: Bool
expires: Time
creation: Time
last_access: Time
seq: Int
}One stored cookie (net/http/cookiejar’s entry). Internal: use the jar.
JarState
struct JarState {
entries: Map[Str, Map[Str, Entry]]
next_seq: Int
}A jar’s state. Internal: use the methods.
Jar
struct Jar {
st: Mutex[JarState]
}A cookie jar. A handle: copies share the cookies, and tasks may use it at once.
Jar.set_cookies
fn (j: Jar) set_cookies(url: http.Url, cookies: List[http.Cookie], now: Time)Stores the cookies a server set for url (Jar.SetCookies): none for a scheme other than http and https, one that has a bad Domain attribute (not the host or a parent of it, or an IP host with a Domain) is ignored, a Max-Age below 0 or an Expires not after now deletes. A host that is not ASCII is ignored (no IDNA yet).
Jar.cookies
fn (j: Jar) cookies(url: http.Url, now: Time) -> List[http.Cookie]The cookies to send with a request for url (Jar.Cookies): name, value and quoted only, the longest path first, then the earliest created. Expired cookies are dropped.
Jar.clear
fn (j: Jar) clear()Forgets every cookie.
Functions
new
fn new() -> JarAn empty jar (cookiejar.New(nil)).
↑ index