I have 2 applications. App1 is some old selfmade php project, not using Zend. And App2 is a little Zend application.
http://test.pmueller.dev.xiag.ch/ This is just for tests. In this case, it represents App1.
If you click show at newsletter 313, you will logged in and see the newsletter. This is a normal cross domain post call. Login was made in the background. Copy paste that url.
Now, delete the cookie. If you reload the tab, you should get an error because you aren’t logged in anymore.
What fails is the following:
You should be logged in, when clicking on the login button. This means, you first click the button. Then, open a new tab an go to the newsletter again you just were.
As you see, the login via ajax doesn’t work. Why? I really couldn’t figure out why it does set my cookie with a normal post but it doesn’t when doing an ajax call.
Make both application’s session handler user the same domain. So if you have app1.foo.bar.com and app2.foo.bar.com you should be doing something like this in both of your apps:
One place for this code is the Bootstrap, but anywhere before you call
Zend_Auth::getInstance()->hasIdentity()or start the session should be ok.