Answer the question
In order to leave comments, you need to log in
Yii. How to update the user's page transition time in the database?
The time of the last visit to the site.
I don't know where to put it. When authorizing, it is clear how to do this. The problem is that I don’t know where the cookie check of an already logged in user takes place, in order to write the time of the visit to the database after this check.
It would be desirable to inherit controllers and register in beforeAction last. Are there any other options?
Answer the question
In order to leave comments, you need to log in
Em. CWebUser looks ingratiatingly in your direction. Inherit, register as a used class in the config, override init, first do parent::init(), then all user data will be available to you if he is not a guest. There you do everything you need. Session recovery occurs just in init.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question