How to track Drupal user login-logout session length and registration activities? Is there any hook_function/code in Drupal where I can track user activity, like:


User core logged in time / or third party login
User log out time
Login-Logout session length (active time)
registration submit core or / third party submit.


Please share event for these activity.
For standard login, and 3rd-party login modules that are properly integrated with core, you can use:


hook_user_login()
hook_user_logout()
hook_user_insert()


For 3rd-party login modules that aren't properly integrated with core (i.e. don't fire those hooks), you'll need to approach each on a case-by-case basis, and find out what hooks they provide.

You could measure the duration of the session in hook_user_logout, by checking the account object's login property against the current time -  there's no hook for such a thing as it's not an event, just a value which needs some context to give it meaning.