is there any way to config CHttpCookie in main.php so that the var domain have some value?
I config main.php in like this.
‘components’ => array(
‘CHttpCookie’=>array(
‘domain’=>’.xxxxx.com’,
),
)
but does not work?
is there any way to config CHttpCookie in main.php so that the var domain have some value?
I config main.php in like this.
‘components’ => array(
‘CHttpCookie’=>array(
‘domain’=>’.xxxxx.com’,
),
)
but does not work?
no one knows?
qiang?
This doesn’t work. You have to set the domain when setting the actual cookie.
but in where set the domain?
Something like:
$cookie = new CHttpCookie('test', '123456');
$cookie->domain = '.example.com';
Yii::app()->request->cookies['test'] = $cookie; // will send the cookie
but how to setting domain in CWebUser ?
when use class CWebUser,method login($identity,$duration=0) ,how to config the cookie domain?
I looked those topic.I look like have some bug?
I don’t understand. Did you tried it and it doesn’t work? More info please.
I config User with ‘allowAutoLoing’ => true
so I should config only User components or User and Session components?
‘components’ => array(
‘user’ => array(
'class' => 'application.components.WebUser',
'allowAutoLogin' => true,
'identityCookie' => array('domain' => '.xxx.com'),
),
),
‘components’ => array(
‘session’ => array(
'class' => 'CDbHttpSession',
'cookieParams' => array('domain' => '.xxx.com'),
),