cookie is not shown in chrome developer tools

自古美人都是妖i 提交于 2020-08-06 07:28:27

问题


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. network tab

request resource

request resource

resource tab


回答1:


Below are 2 potential reasons for not actually setting a valid cookie:

  1. Invalid expiration time - the cookie expires at a time in the past from the browser's perspective
  2. 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

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.




回答2:


It might be that your cookie is the HTTPOnly authentication cookie. Those are not shown in chrome unless you're browsing the localhost.



来源:https://stackoverflow.com/questions/29179805/cookie-is-not-shown-in-chrome-developer-tools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!