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

posted on 2017-02-08 17:52  郑州名扬  阅读(492)  评论(0)    收藏  举报

导航