忐忑书包

文章
9
资源
0
加入时间
3年1月12天

HTTP篇之cookie设置

前台代码:var xhr = new XMLHttpRequest();xhr.open('GET','http://localhost:3000/list');xhr.withCredentials = true;xhr.send();XMLHttpRequest发送请求时需要设置withCredentials属性为true,来允许浏览器在自己的域设置cookie值。如果withCredentials没有设置为true,就会出现Response Headers有Set-Cookie,但