'components'=>array(
'user'=>array(
//'class'=>'CWebUser',//你可以自定义你的Cwebuser
'identityCookie'=>array('domain' => '.domain.cc','path' => '/'),//配置用户cookie作用域
// enable cookie-based authentication
'allowAutoLogin'=>true,//允许同步登录
'stateKeyPrefix'=>'yourprefix',//你的前缀,必须指定为一样的
'loginUrl'=>array('/user/login'),
),
'session' => array(
'cookieParams' => array('domain' => '.domain.cc', 'lifetime' => 0),//配置会话ID作用域 生命期和超时
'timeout' => 3600,
//这里千万不要指定cookieMode => none,否则无法对应sessionid导致无法登录,更别说同步了。(有些不负责的博客竟然说同步登录需要设定这个属性为none!!!!太坑爹了。。。)
),
'statePersister'=>array( //指定cookie加密的状态文件
'class'=>'CStatePersister',//指定类
'stateFile'=>'../CommonLib/protected/runtime/state.bin',//配置通用状态文件路径,注意,如果你的站点是分布式的,你必须把该文件复制一份到不同服务器上,否则无法跨域。因为里面有个通用密钥,密钥不同则无法验证身份。
),
runtime目录的权限必须是777