harttle / harttle.github.io

Harttle Land 的源码和文章
https://harttle.land
Creative Commons Attribution 4.0 International
122 stars 32 forks source link

2016/12/28/cors-with-cookie #86

Open harttle opened 6 years ago

harttle commented 6 years ago

CORS 跨域发送 Cookie | Harttle Land

http://harttle.land/2016/12/28/cors-with-cookie.html

harttle commented 6 years ago

感谢博主分享,请问在Safari上怎么从代码层或网络配置以实现cookie发送到服务端?

By Johnathon 2018-01-11T05:54:12Z

harttle commented 6 years ago

在正常模式下浏览器会自己携带cookie,是否携带网站代码无法干涉

By Yang Jun 2018-02-08T09:40:24Z

harttle commented 6 years ago

今天面试被问到这个了,赶紧来补补

By Nick 2018-03-23T08:21:22Z

linkerlin commented 6 years ago

感谢提供这么好的Blog和Code. 我试了下,其它都是OK的,只有带Cookie的那个例子不行. 返回:I got your cookie: undefined 我看了下server.js, 似乎是: res.status(200).end('I got your cookie: ' + req.headers.cookie);
没有获取到cookie,然后看chrome的控制台,确实没有带cookie. Chrome是最新的Version 66.0.3359.139 (Official Build) (64-bit) 非常不理解哪里不对, 希望您能帮忙看看,谢谢!