The problem between tornado setcookie and domain

ladies and gentlemen, I am using tornado setcookie, but the requester is the same as my first-level domain name, for example, both are baidu.com, but our second-level domain name is different. For example, my interface server (tornado side) is I, and the client"s request domain name is a. Now my set_cookie cannot succeed, but I cannot domain=".baidu.com" in self.set_cookie, so try to find a solution.

May.31,2022

the CORS scheme can be used to solve cross-domain problems caused by the same origin policy.
tornado sets the default header in baseHandler or in interfaces that need to cross domains

def set_default_headers(self):
    self.set_header('Access-Control-Allow-Origin', 'http://a.baidu.com') 
    self.set_header('Access-Control-Allow-Credentials', 'true')
    self.set_header('Access-Control-Allow-Methods', 'POST, GET, OPTIONS')

the general production environment is configured in nginx.

Menu