Session users with the same session

Hello, I have the following problem in Yii2 basic with the use of dektrium: loguin a user opens the session. When login another user shows you the same session of the user who loguin before … I started recently to develop with Yii2, I finished the application and doing the tests I found this problem. I read the dektrium documentation, and look for information in forums, etc., but I can not find anything to guide me to solve the problem. Thank you very much for the help you can give me. regards

It seem more a problem with PHP. Yii2 use the standard sessione start.

Just to be sure.

When you try with the second user, how do you do? Do you use same browser? You logoff the first user then you login the secondo one?

What happen if you use 2 different browser?

I’m dealing with the exact same issue on the advanced template. Doing some digging to try to figure it out.

Managed to figure it out for my setup.

Did you modify the "user" model?

My issue is that I needed to use "andWhere" vs "where". I have 2 "where" conditions and the second was overriding the first. Once I changed the second "where" to "andWhere", the login behavior started working as expected.

This is the correct behavior, where reset all the where() condition of the query and set the new one, while andWhere() orWhere() append the new condition to the existing one.

The same is for filter() orFiler() andFilter()

http://www.yiiframework.com/doc-2.0/guide-db-query-builder.html#appending-conditions