I am using Apache and PHP as my front-end server and Tornado as my back-end to handle my requests. When allowing a user to login I want to create cookies for the username and password. If I do it as follows:
self.set_cookie('emailaddress', email_address, domain='mydomain.com', expires=None, path='/', expires_days=expire_d)
self.set_cookie('password', newpass, domain='mydomain.com', expires=None, path='/', expires_days=expire_d)
Nothing is created. But if I do:
self.set_cookie('emailaddress', email_address)
self.set_cookie('password', newpass)
It works. But than even though the cookies which I can see from Firefox and Firebug but PHP on my front-end doesn't recognize them. Also I know its not from cross-domain because I have my Tornado server Proxy through Apache.
Yes, it seems like the problem is related to subdomains if you are using them to route between Tornado and PHP, without details on this it's hard to tell how to fix it.
But in general maybe it will be a good idea to just map Tornado to some relative url on a main domain and do not mess with subdomains?
P.S.: storing login/password pairs in cookies in plain text is not secure, I'd recomend to use unique session id mapped to users via common database between PHP and Tornado.