This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Cookies with longer paths are listed before cookies with shorter paths.
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: FFY00, IYism, eric.araujo
Priority: normal Keywords:

Created on 2021-10-26 02:29 by IYism, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 29208 IYism, 2021-10-26 02:29
Messages (2)
msg405020 - (view) Author: IYism (IYism) * Date: 2021-10-26 02:29
E.g:
Set-Cookie: a=1; Domain=test.com;      Path=/
Set-Cookie: a=2; Domain=demo.test.com; Path=/

Browser send Cookie: a=2; a=1


According to the agreed specification, a=2 should be read first, not a=1

But the wrong behavior of python is that the cookie reads a=1 by default
msg405380 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2021-10-30 17:56
I don’t know that longer is the right think to look at here, but rather more specific.  Unless I’m mistaken, a cookie for test.com is not read on demo.test.com; it would need to be for .test.com to be read (and in that case the specificity rules in the spec should be followed).
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89773
2021-10-30 17:56:27eric.araujosetnosy: + eric.araujo
messages: + msg405380
2021-10-26 02:29:21IYismcreate