【发布时间】:2018-12-20 21:19:17
【问题描述】:
我已经设置了一个网络服务器,并提供了一条路线。当我用curl 击中它时,我得到:
$ curl -i -X POST http://dev.com:5000/user/check
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 40
Access-Control-Allow-Origin: *
Vary: Cookie
Set-Cookie: session=eyJjaGVjayI6dHJ1ZX0.Dij_Ng.OL7a0pycpZgU45zEIzC5ZTfeCdk; Domain=.dev.com; HttpOnly; Path=/
Server: Werkzeug/0.14.1 Python/3.6.5
Date: Thu, 12 Jul 2018 15:03:18 GMT
{
"result": null,
"status": "ok"
}
但是,当我在 Chrome 中点击它时,调试控制台会报告:
常规
Request URL: http://dev.com:5000/user/check
Request Method: POST
Status Code: 200 OK
Remote Address: 127.0.0.1:5000
Referrer Policy: no-referrer-when-downgrade
响应标头
Access-Control-Allow-Origin: http://localhost:8080
Content-Length: 40
Content-Type: application/json
Date: Thu, 12 Jul 2018 15:04:10 GMT
Server: Werkzeug/0.14.1 Python/3.6.5
Vary: Origin, Cookie
请求标头
Provisional headers are shown
Accept: application/json, text/plain, */*
Origin: http://localhost:8080
Referer: http://localhost:8080/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
不返回任何 cookie。怎么回事?
【问题讨论】:
标签: javascript google-chrome cookies