【问题标题】:Yii2 user identity authenticationYii2用户身份认证
【发布时间】:2017-09-07 06:56:27
【问题描述】:

我在yii2 有两个项目

当我使用yii2身份验证方法登录一个项目时

(Yii::$app->user->identity)

另一个项目也创建了一个登录会话。

我的第一个项目是用户注册,第二个是卖家注册。

以用户(User id is 21- Database id ) 成功登录并打开 卖方项目。还会自动创建一个登录名,用户 ID 为 21,来自 Seller 表。

【问题讨论】:

  • 问题是什么?

标签: php yii yii2-advanced-app


【解决方案1】:

这可能是因为您在项目中启用了 autoLoginLogin,并且您可能使用了相同的 identityCookie 配置。检查您的配置文件..

'components' => [
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => [
                'name' => '_frontendUser',//change this
            ]
        ],

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-16
    • 1970-01-01
    • 2012-03-27
    • 1970-01-01
    • 1970-01-01
    • 2015-02-24
    • 1970-01-01
    相关资源
    最近更新 更多