About Monitoring Users login-logout time

#1

Hello , i hope all is well , i need an orientation or help about monitoring users login - logout time/date , i am near finishing my web app and all what is losing my time is this part . please can i get help over this problem

#2

what you could do is just create a value in the database for when the user logged in, then one for when he/she logged out and compare the two.
preferably you also add a unique identifier if users are allowed to (or able to) login on multiple devices/browsers simultaneously (so you won’t count logging out on device A as logging out on device B)

#3

You can enabled monitoring / user session tracking. I think login and logout information is stored there.

Set the following to true to track user clicks in memory for the duration of a user’s session. Setting this to true allows you to view all live
sessions in the Admin portlet.

session.tracker.memory.enabled=true

Set the following to true to track user clicks in the database after a user’s session is invalidated. Setting this to true allows you to generate the usage reports from the database. Use this cautiously because this will store a lot of usage data.

session.tracker.persistence.enabled=false

#4

This is not a smart idea to do because,w here would you need to change this? and you are now tracking your users all over your site, which can cause some privacy issues.