php - Custom Identity loses session information -


for reason, after logging in, user details gets lost.

i created customer class, implemented identityinterface , extended activerecord class.

when customer logs in, customer authenticated. noticed @ point (using var_dump) yii::$app->user set appropriate customer instance, , noticed yii::$app->session enabled. right after $model->login() function; $model here instance of de-facto loginform below.

public function login() {     if ($this->validate()) {         return yii::$app->user->login($this->getcustomer(), $this->rememberme ? 3600 * 24 * 30 : 0);     } else {         return false;     } } 

however, after redirect in $this->goback(), noticed yii::$app->user — once instance of yii\web\user, identityclass @ app/models/customernull. noticed session @ point (immediately after redirect) null.

this means yii::$app->user->isguest true after customer has been authenticated.

how carry logged-in user along through redirect?


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -