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

相關文章
相關標籤/搜索