samedi 18 avril 2015

How to pass cookies between subdomains? Change cookie domain?

Okay so this is my current situation.


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.


Based on couple hours of research, it seems like I need to change the domain of cookie.


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.


So my question is...how do I change the cookie domain? Or are there any other ways to do it?


My current stack is


nginx for reverse proxy | node.js(express.js) for front end server | python(flask) and mysql for api server | redis for session saving


They are all running in a same box.


Aucun commentaire:

Enregistrer un commentaire