Wednesday, June 30, 2010

Sessions across multiple apps, same domain

I'm fairly new to cake, but an experienced PHP developer. I have a
production setup of cake. It looks as follows:

/home/keven/cake1.3 - This contains the 'spark_plug' plugin, which
handles authentication
/home/keven/app1
/home/keven/app2

Webroot is located here:

/var/www/login
/var/www/contest
/var/www/game

The idea is that a user logs in, then goes to another app where their
login details are supposed to be kept within session data or the $user
object from spark plug plugin.

The problem is that sessions are not being passed app to app. I've
even tried to set a session explicitly in one app and tried to read it
in another and it is blank. (ie, first app: $_SESSION['try'] = 'this'
-- second app: print $_SESSION['try'];

Any ideas would be greatly appreciated. Thanks in advance everyone

----------------------------------------------------------------------------------------------------------------------------

More about my setup:

Cake 1.3.2
Configure::write('Session.checkAgent', false);
Configure::write('Security.level', 'medium'); *** I've also tried
'low'
Configure::write('Security.salt',
'LKJd2ou43kljLKDJfkljueoiru34asdfk3'); *** this is the same across all
apps

I've read the following articles to no avail:

http://bakery.cakephp.org/articles/view/how-to-bend-cakephp-s-session-handling-to-your-needs
http://www.amityadav.name/cakephp-sharing-sessions-between-apps-on-the-same-domain

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: