package cookiejar
Import Path
net/http/cookiejar (on golang.org and go.dev)
Dependency Relation
imports 10 packages, and imported by 0 packages
Involved Source Files
d-> jar.go
punycode.go
Exported Type Names
type Jar (struct)
Jar implements the http.CookieJar interface from the net/http package.
Cookies implements the Cookies method of the http.CookieJar interface.
It returns an empty slice if the URL's scheme is not HTTP or HTTPS.
SetCookies implements the SetCookies method of the http.CookieJar interface.
It does nothing if the URL's scheme is not HTTP or HTTPS.
*T : net/http.CookieJar
func New(o *Options) (*Jar, error)
type Options (struct)
Options are the options for creating a new Jar.
PublicSuffixList is the public suffix list that determines whether
an HTTP server can set a cookie for a domain.
A nil value is valid and may be useful for testing but it is not
secure: it means that the HTTP server for foo.co.uk can set a cookie
for bar.co.uk.
func New(o *Options) (*Jar, error)
type PublicSuffixList (interface)
PublicSuffixList provides the public suffix of a domain. For example:
- the public suffix of "example.com" is "com",
- the public suffix of "foo1.foo2.foo3.co.uk" is "co.uk", and
- the public suffix of "bar.pvt.k12.ma.us" is "pvt.k12.ma.us".
Implementations of PublicSuffixList must be safe for concurrent use by
multiple goroutines.
An implementation that always returns "" is valid and may be useful for
testing but it is not secure: it means that the HTTP server for foo.com can
set a cookie for bar.com.
A public suffix list implementation is in the package
golang.org/x/net/publicsuffix.
PublicSuffix returns the public suffix of domain.
TODO: specify which of the caller and callee is responsible for IP
addresses, for leading and trailing dots, for case sensitivity, and
for IDN/Punycode.
String returns a description of the source of this public suffix
list. The description will typically contain something like a time
stamp or version number.
T : expvar.Var
T : fmt.Stringer
Exported Values
![]() |
The pages are generated with Golds v0.1.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project and developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |