i have created a new identity class, i have implemented IdentityInterface and all the necessary methods. note that it does NOT extend ActiveRecord, but rather extends my own base Model class that does not derive from AR.
everything seems to work fine - i can log in and be correctly authenticated. i have debugged the code and i can see that my identity class is correctly set in Yii::$app->user after IdentityInterface::validatePassword() and User::login() have been called.
however, once the login succeeds and the user is redirected, Yii::$app->user contains an empty IdentityInterface, rather than the one that was there immediately prior to the redirect. i have traced through code in yii\web\Controller, yii\base\Controller, yii\web\Response, SiteController, yii\web\User, etc., and i cannot see where the identity is getting lost. i only see that as soon as i am redirected after the successful login, the Yii::$app->user contains an empty identity, not the one that it contained immediately before the redirect.
i am not sure if this is a session issue (i don’t see anything in the session that seems to hold a yii\web\User), or what.
i should mention that when i change my app to use an ActiveRecord-based identity, it works fine - the identity is retained after the successful login redirect. but i have traced through all the code there as well, and i don’t see what is different in the logic.
any help at all would be GREATLY appreciated.
EDIT: forgot to mention that i am using the backend app of the advanced application template, yii2.