cors时session取数据失败
作者:互联网
cors时session取数据会失败,因为传递的session id不一致。
** 解决方法
- server的controller上用注释@CrossOrigin(origins="", allowedHeaders = "", methods = {}, allowCredentials = "true"),allowCredentials值必须为true。
- client的项目中axios.defaults.withCredentials = true
标签:methods,allowCredentials,session,失败,cors,true 来源: https://www.cnblogs.com/mryux/p/15389935.html