我正在尝试使用Axios HTTP请求调用验证Express API后端。虽然我能够在响应头中看到'Set-Cookie',但cookie并没有设置。是否可能通过Axios HTTP调用设置Cookie?
Access-Control-Allow-Origin: * Connection: keep-alive Content-Length: 355 Content-Type: application/json; charset=utf-8 Date: Fri, 28 Sep 2018 05:59:01 GMT ETag: W/"163-PAMc87SVHWkdimTJca7oRw" Set-Cookie: token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...; Max-Age=3.6; Path=/; Expires=Fri, 28 Sep 2018 05:59:04 GMT; HttpOnly X-Powered-By: Express
withCredentials
只对 HTTP 基本身份验证有用。 - Billal BegueradjwithCredentials
对于发送和设置 cookies 也非常有用。 - Aposhian