chrome开发人员工具中未显示cookie [英] cookie is not shown in chrome developer tools
问题描述
我正在使用node/express服务器和angularjs作为前端.服务器设置cookie,并在网络响应中正确显示.但Cookie不会显示在chrome开发人员工具的资源"标签中.相同的可能原因是什么?
i am using node/express server and angularjs as frontend. server sets the cookie and is shown correctly in the network response. but the cookie is not shown in the resource tab in the chrome developer tools. What are the possible reasons for the same.
推荐答案
以下是未实际设置有效cookie的两个潜在原因:
Below are 2 potential reasons for not actually setting a valid cookie:
- 无效的到期时间-从浏览器的角度来看,Cookie会在过去的某个时间过期
- 无效的域(用于Cookie).假设您从 example.com 提供页面,但是您的服务器尝试为域 google.com 设置Cookie.
- Invalid expiration time - the cookie expires at a time in the past from the browser's perspective
- Invalid domain for the cookie. Let's say you serve the page from example.com, but your server tries to set the cookie for domain google.com
chrome开发工具中也可能存在一个错误,即不显示您的cookie,但是您可以通过向服务器发出另一个请求并查看服务器实际收到了哪些cookie,来轻松地进行检查.
There could also be a bug in the chrome dev tools to not show your cookies, but you can check that easily by issuing another request to the server and see what cookies are actually received by the server.
这篇关于chrome开发人员工具中未显示cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!