Why does the number of cookies in the "Cookie" request header exceed the number of cookies set in the "set-cookie" response header?
P粉244155277
P粉244155277 2024-04-05 14:52:06
0
1
3825

I am a newbie to web crawling, so my understanding of http requests is very shallow. When I inspect certain requests I send to a website, such as add to cart, the dev tools show that there are more values ​​ in the "Cookie" header of the request, which are set by "set -cookie" response header is set.

How does this work?

More specifically, one cookie in the "set-cookie" header of the response will contain the cart id, but when looking at all cookie values ​​in the request header, there will also be a cart id in the "Cookie" header , but there are other cookies such as "checkout session lookup" and "checkout session token".

However, these cookies are not set in the "set-cookie" header of the response, so how do they get there?

Suppose I want to grab the complete "Cookie" value of all cookies included in the request header, not just those cookies in the response header. Is there a way to do this?

Thank you for your help!

P粉244155277
P粉244155277

reply all(1)
P粉667649253

I think this may be related to the JavaScript on this page. For example, the following code sets a new cookie: document.cookie="username=John Doe";

Therefore, cookies can not only be sent through request headers.

To get the full cookie, I think you might need a headless browser.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template