I'm working on a Symfony 1.4 project and I would like to do:
I use "sfDoctrineGuardLoginHistoryPlugin" for the history of login and logout .
This plugin uses a listener on the session state change and checkout the database login or logout status But the problem when the moderator leaves the page open a long time and does not touch anything or when he closes the browser so there is no action recorded in the database
is there any solution in (php or Node Js or Ajax ...) to know when the user's session went off ?
There's nothing in Symfony 1.4 for this that I'm aware of.
One potential workaround could be to ensure you're updating some kind of last_active timestamp whilst a moderator is using the website in addition to the login and logout times. The updating could be done using a filter, for example.
This would then allow you check if the user has logged out OR was last active > 30 minutes ago, basically emulating a scenario where the user has just closed the browser window or allowed the authenticated session to expire without logging out.