每个 Web 请求都会发送浏览器 cookie 吗? [英] Does every web request send the browser cookies?
问题描述
每个网络请求都会发送浏览器的 cookie 吗?
Does every web request send the browser's cookies?
我不是在谈论页面浏览量,而是对图像、.js
文件等的请求
I'm not talking page views, but a request for an image, .js
file, etc.
更新如果一个网页有 50 个元素,那就是 50 个请求.为什么它会为每个请求发送相同的 cookie,它不缓存或不知道它已经拥有它?
Update If a web page has 50 elements, that is 50 requests. Why would it send the SAME cookie(s) for each request, doesn't it cache or know it already has it?
推荐答案
可以,只要请求的 URL 位于 cookie 中定义的相同域和路径内(以及所有其他限制——安全、httponly、不expired 等)hold,那么每次请求都会发送 cookie.
Yes, as long as the URL requested is within the same domain and path defined in the cookie (and all of the other restrictions -- secure, httponly, not expired, etc) hold, then the cookie will be sent for every request.
这篇关于每个 Web 请求都会发送浏览器 cookie 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!