Lines Matching refs:Path
67 // their name/domain/path.
95 Path string
105 // deterministic order, even for cookies that have equal Path length and
110 // Id returns the domain;path;name triple of e as an id.
112 return fmt.Sprintf("%s;%s;%s", e.Domain, e.Path, e.Name)
116 // request to host/path. It is the caller's responsibility to check if the
118 func (e *entry) shouldSend(https bool, host, path string) bool {
119 return e.domainMatch(host) && e.pathMatch(path) && (https || !e.Secure)
130 // pathMatch implements "path-match" according to RFC 6265 section 5.1.4.
132 if requestPath == e.Path {
135 if strings.HasPrefix(requestPath, e.Path) {
136 if e.Path[len(e.Path)-1] == '/' {
137 return true // The "/any/" matches "/any/path" case.
138 } else if requestPath[len(e.Path)] == '/' {
139 return true // The "/any" matches "/any/path" case.
151 // section 5.4 point 2: by longest path and then by earliest creation time.
157 if len(s[i].Path) != len(s[j].Path) {
158 return len(s[i].Path) > len(s[j].Path)
195 path := u.Path
196 if path == "" {
197 path = "/"
208 if !e.shouldSend(https, host, path) {
252 defPath := defaultPath(u.Path)
365 // defaultPath returns the directory part of an URL's path according to
367 func defaultPath(path string) string {
368 if len(path) == 0 || path[0] != '/' {
369 return "/" // Path is empty or malformed.
372 i := strings.LastIndex(path, "/") // Path starts with "/", so i != -1.
374 return "/" // Path has the form "/abc".
376 return path[:i] // Path is either of form "/abc/xyz" or "/abc/xyz/".
381 // default-path and the canonical host name of the URL c was received from.
385 // be valid to call e.id (which depends on e's Name, Domain and Path).
391 if c.Path == "" || c.Path[0] != '/' {
392 e.Path = defPath
394 e.Path = c.Path