A
A
AlikDex2015-08-16 23:38:42
Yii
AlikDex, 2015-08-16 23:38:42

Yii 2, updating user's last action time?

In pursuit of the topic .
I decided to do it in a clumsy way without any sockets. So.
Which method of updating the time of the last action / transition should be chosen as the most optimal?
1) rely solely on data from Ajax;
2) update using actions in controllers, or in the User model by adding finIdentity to the method, or making a global before action;
3) a mix of the methods above;
4) I don't know how anymore, tell me ;D
P.S.
This is generally normal, no?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2015-08-17
@webinar

before action - in my opinion the best option. Simple and works, resources are not particularly annoying. Revealing the "ends of the connection" will lead you to the fact that then you have to somehow connect them with the user id. Why reinvent the wheel?

G
Greg Popov, 2015-08-17
@Gregpopov

Решил делать топорным способом без всяких сокетов

Подумайте еще раз. И сделайте примерно так:
AJAX это перегруз. Полный перегруз.
Давайте посмотрим сзади: зачем вы пытаетесь выявить последнее действие, если можно просто выявить «конец соединения»?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question