title: How to pass cookies between subdomains? Change cookie domain?
body: <p>Okay so this is my current situation.</p>
  
  <p>I am trying to send an ajax request to api.mysite.com from main.mysite.com. Everything is working fine but cookies are not being sent.</p>
  
  <p>Based on couple hours of research, it seems like I need to change the domain of cookie. </p>
  
  <p>In my case, cookie domain is main.mysite.com, and cookie domain should be .mysite.com if I want to include cookie in ajax requests.</p>
  
  <p>So my question is...how do I change the cookie domain?  Or are there any other ways to do it?</p>
  
  <p>My current stack is </p>
  
  <p>nginx for reverse proxy |
  node.js(express.js) for front end server |
  python(flask) and mysql for api server |
  redis for session saving</p>
  
  <p>They are all running in a same box.</p>