I found this problem early. Now I find that many times it affects my program. Description:
1: If cookie1 is obtained by requesting www.xxx.com/a/a.php
2: If cookie2 is obtained by requesting www.xxx.com/ B/B .php
When I request www.xxx.com/c/c.php, both cookie1and cookie2cannot be automatically added. Why. Because the path values of cookie1 and cookie2 are different, the solution is as follows: when the cookie is obtained, set the path value first, then add it to cookiecontainer ..
In fact, it is not completely a cookiecontainer problem. When this problem occurs, it is also related to the server. For example, if there is no path in the Set-cookie in the server's response, cookiecontainer directly uses the current request path as the path .. If the set-cookie in the server's response has a path, cookiecontainer will still be set normally.
I always think it is not perfect ..