I have two distinct web applications that are hosted on the same server, and the two web applications are on totally different domains. The web applications will have many users in common though, so I want to share logins between the two applications. In my web applications I set a cookie as the session ID. How can I get the web applications to see the other applications session ID?
In case you guys need more info the server is your standard LAMP server and the applications are using the CakePHP framework.
Thanks in advance!
You can’t. Well you can, but strictly speaking a Cookie can only be used on one domain (and all subdomains, depending on Cookie path set in app/config/core.php in the case of your CakePHP app).
CakePHP or no CakePHP, a cookie can’t be used across domains. But there is a work around. This is quite common question on SO.. here is a great answer:
How do I use cookies across two different domains?