yii2配置子域名自动登录
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
'identityCookie' => [
'name' => '_identity-frontend',
'domain'=>'.xxx.com',
'httpOnly' => true,
'path'=>'/'
],
],
'session' => [
'cookieParams' => [
'path' => '/',
'domain' => '.xxx.com',
],
// this is the name of the session cookie used for login on the frontend
'name' => 'advanced-frontend',
],
在需要同步登录的app里配置main.php
浙公网安备 33010602011771号