Hi,
I am looking at sharing sessions between two Yii applications. For example I have a frontend website that connects to a backend site on a different server with different domain names. How do I share the sessions between each other?
Shouldn’t this work?
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
'class' => 'MyWebUser',
'identityCookie' => array(
'domain' => 'localhost',
),
),
'session' => array(
'savePath' => dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'temp',
'cookieMode' => 'allow',
'cookieParams'=> array(
'path' => '/',
'httpOnly' => false,
'domain' => 'localhost',
),
),
And add this to MyWebUSer class?
class MyWebUser extends CWebUser
{
public $identityCookie = array(
'path' => '/',
'domain' => 'localhost',
);
Thanks!
Ratty