After login user auto logout

Using Yii2 Basic.

Created custom activerecord, which extends activerecord. And user model extends custom activerecord.

Login works perfect, but after login when user redirects to dashboard, user auto logout and all session expires.

For login used activeform, activeform ajax validation, and submitbefore.

Using custom activerecord as I have some criteria for using different database as per session.

Check permissions for session files (usually /tmp/) and runtime.

Using windows, wamp server.