title: Yii 2 Separate User Instance in Module
body: <p>I have two different user table(editors and users) in database. User table as you know and the Editor table is just using in module.</p>
  
  <p>I use <a href="http://www.yiiframework.com/wiki/80/add-information-to-yii-app-user-by-extending-cwebuser-better-version">this way</a> to separating user instances from between module and main application in Yii 1.1.</p>
  
  <p>But I can't find a way in yii 2. I try extend yii\web\User and I change user class in module but same results. If I login in module, same User instance is accessible from out of module and anywhere.</p>
  
  <p>My module init like this:</p>
  
  <pre><code>public function init()
  {
      parent::init();
  
      \Yii::$app-&gt;set('user', [
          'class' =&gt; 'app\modules\yonetim\components\yonetimUser',
          'identityClass' =&gt; 'app\models\Editor',
          'enableAutoLogin' =&gt; true,
          'loginUrl' =&gt; ['yonetim/default/login'],
      ]);
  }
  </code></pre>
  
  <p>Also I try this way; in config.php</p>
  
  <pre><code>'components' =&gt; [
      'user' =&gt; [
          'identityClass' =&gt; 'app\models\User',
          'enableAutoLogin' =&gt; true,
      ],
      'editor' =&gt; [
          'class' =&gt; 'yii\web\User',
          'identityClass' =&gt; 'app\models\Editor',
          'enableAutoLogin' =&gt; true,
      ],
  ],
  </code></pre>
  
  <p>But this time I don't use authorization roles(like @)</p>
  
  <p>How can I use different User instance in my module ?</p>