views:

270

answers:

1

Hi guys,

Ok, here goes a very strange problem...

Our team is using cakephp to develop a large application. Everything session related is working properly so far. The only issues we've had so far are related to iframes and opening windows in other subdomains. I'll explain:

  1. User opens up site A and logs into it, creation a User in a session. Cookies are set, everything works as expected.
  2. The user clicks a link that opens up Site B via Javascript. When they go to that site, they are automatically logged in by a backend mechanism and infrastructure. Site B is a subdomain of Site A.
  3. On that site there is another mechanism to go back to the first page (a link rather) that logs them back in to site A. The fun part about this whole process is the following, and that on step 3, when we click on the link, the session on Site A has been lost. I know it's lost because it is forcing login again.

I am a bit lost, as the rest of the application that work with AJAX and uses iframes and stuff works flawlessly, just this one item does not work as one would expect. Any assistance would be appreciated.

Cheers, Valentin

A: 

I am not sure if this will help but I think to be able to use sessions across subdomains you have to specify this in your php.ini file. Have a read of this: session.cookie_domain

You may need to do something like this:

session.cookie_domain = ".example.com"

Or via your htaccess file:

php_value session.cookie_domain ".example.com"
Abs