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.phpphp

相关文章
相关标签/搜索