title: How would I use cookies from two domains?
body: <p><strong>Hello,</strong></p>
  
  <p>I'm trying to create my own cross domain authentication platform. I'm having some issues with cookies. I have a master domain (<code>master.com</code>) and an app domain (<code>app.com</code>). </p>
  
  <p><strong>Here is the Issue:</strong></p>
  
  <ul>
  <li><code>app.com</code> requests a JavaScript file from <code>master.com</code></li>
  <li>The File executes a Jquery Get request to a flask server on <code>master.com</code></li>
  <li><code>master.com</code> sets a 'session' cookie through <code>Set-Cookie:</code></li>
  <li><code>app.com</code> or <code>master.com</code> does not have the cookie</li>
  </ul>
  
  <p><strong>This is my flask server code as current:</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>def set_cookie(response,cookies,domain=".app.com",age=3600*48):
     header = ""
     for h in cookies.keys():
         header=header+"{}={}; ".format(h,cookies[h])
     cook = "{}max-age={}; domain={};".format(header,age,domain)
     response.headers["Set-Cookie"] = cook
     return response
  
  set_cookie(resp,{"session-id":"a UUID","session-key":"another UUID"})
  </code></pre>
  
  <p>And this is the request code:</p>
  
  <pre><code>$.post("https://master.com/api/endpoint")
  </code></pre>
  
  <p>Any help would be greatly appreciated.
  -Sam</p>