A login was made in Vue. After the login is successful, no cookie is returned.

I made a login in vue, and after logging in successfully, I should receive a cookie. But no cookie was received.

Axios global settings
import axios from "axios"
Vue.prototype.$axios = axios
axios.defaults.crossDomain = true;
axios.defaults.withCredentials  = true;
Log in
_getUserData () {
    let data2 = qs.stringify(this.loginInfo)
    this.$axios.post("/apis/jxue/a/login",data2,{
        headers:{
            "Content-Type":"application/x-www-form-urlencoded"
        },
        withCredentials:true
    })
    .then((res)=>{
        console.log(res);
    })
}
this is the result of the request

clipboard.png

Cookie

clipboard.png

because the cookie returned to me by the backend contains confirmation login information such as ID. But I can"t get it now.

Mar.23,2021

1 first check with the backend whether the cookie information you want has been returned, and ask where it is returned.
2 check your console.log res carefully.
https://blog.csdn.net/lohiauf.


Hello, have you solved your problem? I have the same problem


Hello, have you solved it? How to solve

Menu