How to use EVENT_AFTER_LOGIN in yii2 ?
EVENT_AFTER_LOGIN is a constant.
Question : how can it be used to record the time of user logon?
Appendix to the question: why do we need some similar events in this case, when we can record the user's login time, from класса User метода public static function findIdentity ?
Here is what is written, but no example shows how to use this event.
You can use these events to implement the login audit feature, online user statistics. For example, in the handler for EVENT_AFTER_LOGIN, you can record the time and IP address of the entry in the user table.
Well, and of course yes, EVENT_AFTER_LOGIN only works if the login is successful, this is the same if we inserted our date entry method into the Login () method. In general, it is not clear why this is necessary.
EVENT_AFTER_LOGINonly works if the login is successful, this is the same if we inserted our date method into the Login () method. In general, it is not clear why this is necessary. - gilo1212