How to override afterLogin method in yii2?
Where Should I write?
protected function afterLogin($identity, $cookieBased, $duration)
{
}
I'm New to yii2. Please Guide me.
How to override afterLogin method in yii2?
Where Should I write?
protected function afterLogin($identity, $cookieBased, $duration)
{
}
I'm New to yii2. Please Guide me.
You need to implement the afterLogin method in your User ActiveRecord class.
So assuming you have set up your projects you'll find the User class in your models folder.
So just add the afterLogin method to that class to do whatever post-login processing you need to.