2015-12-10 13:42
浏览 44


Lets say i have 2 projects using Yii2, i store it on my /opt/lampp/htdocs A and B folders. When i tried to login to the second project, the first project i logged on is logout. For example when i login on B project after logged in A project, A project is logged out. And when i login on A project after logged in B project, B project is logged out. Are they share same session or what? Thank you.

图片转代码服务由CSDN问答提供 功能建议

假设我有2个项目使用Yii2,我将它存储在我的 / opt / lampp / htdocs < / code> A B文件夹。 当我尝试登录第二个项目时,我登录的第一个项目是注销。 例如,当我登录< 登录后的代码> B项目 项目项目已注销。 当我登录 A项目之后 登录 B项目 B项目已注销。 他们是否共享相同的会话或什么? 谢谢。 \ n

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douyu1990 2015-12-10 14:31

    try to manually config each app user and session components as follow :

    'user' => [
        'identityClass' => 'app\models\User', // or whatever user class you are using
        'enableAutoLogin' => true,
        'identityCookie' => [
            'name' => 'app1_user', // should be unique in each app
            'path'=>'/path_app_1/web'  // path to app 1.
    'session' => [
        'name' => 'app1_session_id', // should be unique in each app
        'savePath' => __DIR__ . '/path_app_1/runtime', // unique folder to store app 1 related session data
    解决 无用
    打赏 举报

相关推荐 更多相似问题