I was looking for a way to check when users were active on my site. My first idea is to create a datetime field in a database called last login, every time a user logs in, it will be updated.
Everything seems to be fine, but when the user has the 'keep me logged' token, the session will remain active and he will not have to go through the login process for a while, violating the accuracy of the active date (I can send an email βWe miss youβ when in fact he is an active user)
Another approach, which, as I thought, was to have some key actions that cause an βactiveβ save, but again, the user would not be able to perform some of these actions having the same problem.
Since I cannot update the field in each user action for performance reasons, what would be a good approach for this? What do pros use?
Edit: I know that Laravel has authentication classes; Does any of these functions activate when the user returns (even if he is still logged in)?
source share