问题
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.
回答1:
Below are 2 potential reasons for not actually setting a valid 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
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