0
i can monitor how long a user is logged in on a specific page? Saving in the database the time he has been.
The leadership here wants to know if the leaders are using a reporting service provided by us, I already monitor the date and time they access, have any php or javascript function that does this? I didn’t find anything like it
You define some kind of
setInterval
Every minute you can make a request to the server, adding in 1 minute the backend. It won’t overload your server, from what I’m seeing, otherwise I’d recommend something else.– Alex
you say do a javascript doing an update every 1 minute? How would I catch the time? Or simply do a sum of 1 in 1?
– Ricardo Gonçalves
every minute of your
setInterval
can make a call to your server, like:fetch('api.com/increaseTime')
the routeincreaseTime
will take from the bank, how many minutes have you saved, add with 1, and save.– Alex
you can by an example script as response?
– Ricardo Gonçalves