php - yii2 generates two sessions after logging in, chrome browser
阿神
阿神 2017-05-16 12:59:33
0
1
527

Yii2 framework, after automatic login is turned off, when logging in with browsers such as Chrome browser, domestic 360, and QQ browser, two sessions will be generated, one is the precise domain name of this website, and the other is the vague second-level domain name . If multiple websites use the same second-level domain name, one website will be forcibly kicked down when switching back and forth. Because there is one more session. Waiting online for rescue by the great god

阿神
阿神

闭关修行中......

reply all(1)
为情所困

Post your session configuration

In the config/main.php of your project,

return [
    ...
    'components' => [
        ...
        'session' => [
            'class' => 'yii\web\Session',
            'cookieParams' => [
                'domain' => 'backend.mysite.com', // 这里固定你的session域名
                'lifetime' => 3600 * 24 * 30,
            ],
            'name' => 'PHPSESSID_FOR_BACKEND', // 最好是不同的域名也设置不同的name
        ],
        ...
    ],
    ...
];
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template