Transfer cookie between vue different domain names (the first-level domain name is the same)

problem description

vue project needs to pass cookie

clipboard.png

the local localhost is set to http://a.xxx.com (the domain name of the project deployment)

proxy is set:

proxyTable: {
      "/apis": {    
        target: "http://b.xxx.com/",  // 
        changeOrigin: true,  //
        pathRewrite: {
            "^/apis": ""   //rewrite,
        }              
      }
    },

how to bring cookie? when requesting

Mar.28,2021

if the request is sent by axios, please refer to this link https://codeshelper.com/a/11.,
if you are using fetch, you can set credentials:'include'

.
Menu