Skip to content

Commit 18c7507

Browse files
committed
docs: note RFC 6265 5.1.4 compliance in cookie.path documentation
1 parent 0675889 commit 18c7507

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ More information about can be found in [the proposal](https://github.com/privacy
126126
Specifies the value for the `Path` `Set-Cookie`. By default, this is set to `'/'`, which
127127
is the root path of the domain.
128128

129+
Since 1.19.1, path matching follows [RFC 6265 section 5.1.4][rfc-6265-5.1.4]. This means
130+
the session middleware will only activate when the request path is an exact match or falls
131+
under a segment boundary of the cookie path. For example, a cookie path of `/admin` will
132+
match `/admin` and `/admin/users` but will **not** match `/administrator`. Prior versions
133+
used a simple prefix check that did not enforce segment boundaries.
134+
129135
##### cookie.priority
130136

131137
Specifies the `string` to be the value for the [`Priority` `Set-Cookie` attribute][rfc-west-cookie-priority-00-4.1].
@@ -1048,6 +1054,7 @@ On Windows, use the corresponding command;
10481054

10491055
[MIT](LICENSE)
10501056

1057+
[rfc-6265-5.1.4]: https://datatracker.ietf.org/doc/html/rfc6265#section-5.1.4
10511058
[rfc-6265bis-03-4.1.2.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7
10521059
[rfc-cutler-httpbis-partitioned-cookies]: https://tools.ietf.org/html/draft-cutler-httpbis-partitioned-cookies/
10531060
[rfc-west-cookie-priority-00-4.1]: https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1

0 commit comments

Comments
 (0)