Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.4k views
in Technique[技术] by (71.8m points)

本地代码调试接口的时候火狐没问题,谷歌chrome就有问题?

chromeimageimage火狐imageimagechrome版本image火狐版本image

同一套代码 为什么chrome的响应头会有一个set-Cookie httpOnly 请求头没有cookie字段导致接口401,但是火狐的响应头没有set-Cookie请求头有携带cookie所以没有出现401. 请求使用的是axios, withCredentials也设置为true了。什么原因?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

已经找到原因了,sameSite的问题,chrome把SameSite by default cookies关掉就好了。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...