yiisoft / yii2-debug

Debug Extension for Yii 2
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
202 stars 150 forks source link

Login issues while debug is activated #337

Open calete opened 5 years ago

calete commented 5 years ago

I have the basic template installed with a module "admin". In admin module I specify the session name Yii::$app->session->name = 'back';

In the main config I specify 'session'=>[ 'name'=>'front' ],

On both sides (back and front) I made a login form. If the debug module is activated I cannot login within the admin module, only in the "front", and when I go to the admin module I get the user logged from the front.

If I deactivate the debug module, I can successfully login independent from the admin or from the front module.

This happens on yii-debug >= 2.0.10. On 2.0.9 I can login in admin but it shows as a "guest" under the debug bar.

Additional info

Q A
Yii version 2.0.15.1
PHP version 7.0.30
Operating system Debian 9.5
calete commented 5 years ago

If I deactivate "users" corePanel it works fine on last version.

cebe commented 5 years ago

where exactly do you set Yii::$app->session->name = 'back'; ?

calete commented 5 years ago

In "admin"module file (@app/modules/admin/AdminModule.php) in the "init" function

public function init() { parent::init(); // custom initialization code goes here Yii::$app->session->name = 'back'; }

cebe commented 5 years ago

Could you put together a small app (based on yii2-app-basic) that shows the problem? It's hard to guess what is happening here, so we need some code to dig into.

calete commented 5 years ago

It's under https://github.com/calete/debugerror

A working demo is under https://debugerror.colservers.cloud/working/web/ There you can login under admin and front.

In contrast, in https://debugerror.colservers.cloud/noworking/web/ you cannot login under admin module.

For easy, I put some links under the main navbar, and two git tags, working and noworking. the only difference between them are that in the working version the debug module is commented.