简体   繁体   English

如果您从 chrome 开发工具控制台发出 http 请求,它会包含您当前所在页面的 cookie 吗?

[英]If you issue an http request from the chrome dev tools console, will it include the cookies of the page you're currently on?

As an example, if I'm logged into stackoverflow and I use the fetch api in the chrome dev tools console to hit a stackoverflow.com endpoint, will my cookies from this domain be included?例如,如果我登录到 stackoverflow 并使用 chrome 开发工具控制台中的fetch api 访问 stackoverflow.com 端点,我来自该域的 cookie 是否会被包含在内?

Yes.是的。 If you go to the Network tab, open the console, and simply run fetch('https://stackoverflow.com') , you can see a request appear in the Network list.如果转到“网络”选项卡,打开控制台,然后简单地运行fetch('https://stackoverflow.com') ,您会看到一个请求出现在“网络”列表中。 From there you can click on the request and clearly see the Request Headers (including Cookie: , containing all your cookies sent) with a quick scroll-down, and Chrome will also give you a separate tab for viewing the cookies in a table.从那里您可以单击请求并通过快速向下滚动清楚地看到请求标头(包括Cookie: ,包含您发送的所有 cookie),Chrome 还会为您提供一个单独的选项卡,用于查看表格中的 cookie。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Chrome开发者工具-您可以撤消控制台中的更改吗? - Chrome Dev Tools - Can you undo changes in the console? AJAX 对 PHP 服务器的 POST 请求:控制台上的无效请求(格式错误的 HTTP 请求)和 .net::ERR_EMPTY_RESPONSE 上的 chrome 开发工具 - AJAX POST request to a PHP server: Invalid request (Malformed HTTP request) on console and net::ERR_EMPTY_RESPONSE on chrome dev tools 如何使用jquery将事件或功能从Chrome开发者工具控制台追加到当前页面? - How to append events or functions using jquery, from Chrome Dev Tools Console to the current page? 使用JQuery的Dev Tools Chrome可以启用/禁用内容 - Dev Tools Chrome with JQuery you can enable / disable stuff 使用chrome dev工具查找代码中的http请求 - find where in the code an http request was made using chrome dev tools 在Chrome开发工具中进行修改/调试后,在控制台中重新实例化AngularJS代码 - Re-instantiate AngularJS code in console after amendment / debug in Chrome Dev Tools 来自发布请求的有效负载显示在 dev chrome 工具中 - Payload from post request showing in dev chrome tools chrome dev-tools>Application>Cookies下没有设置cookies? - Cookies are not set under chrome dev-tools>Application>Cookies? 如何使用 JavaScript(来自 Dev Tools)在 Chrome 中保存完整页面? - How to save a complete page in Chrome using JavaScript (from Dev Tools)? Chrome Dev Tools 控制台 - 以编程方式选择框架 - Chrome Dev Tools console - select frame programmatically
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM