S
S
salminads2019-07-10 11:59:00
Laravel
salminads, 2019-07-10 11:59:00

How to find out how many people are authorized on the site?

Good afternoon.
It is necessary to implement the functionality of how many people are currently on the site.
That is, specialists are sitting on the site, you need to display the number of how many people actually sit on the site online or are simply authorized.
The site is written in Laravel.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Shamanov, 2019-07-10
@SilenceOfWinter

you make a js script that pokes a user with a wand every N minutes - isn't it dead? and sends the data to the server

I
Ivan Zhuk, 2019-07-10
@ivan_zhuck

If you need to monitor how many authorized users are online now, then you can write somewhere (for example, in Redis) the user ID and the time of his last page view, then select the number of users who viewed pages no later than 5 minutes ago.
For unauthorized ones, you can do about the same thing, only identify them by hash from user-agent+IP.

K
kafkiansky, 2019-07-10
@mad_maximus

take a centrifuge (web sockets), set the config to join_leave = true, now you can instantly get the actual number of people on the site as soon as a person closes or opens a tab.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question