Login logout tracking


I want to track Login and logout time of my users,
My website is in PHP, I want to store that in my database (MySQL),

Is there any api for that?

The user count is less than 1k.

Please help.

Hi @spppandey252,

Welcome to the Auth0 Community!

I understand that you’d like to track your user’s login and logout times.

The Management API v2 Get a user endpoint allows you to find the user’s last_login timestamp, which can be used to track the user’s login timestamps. However, it does not offer a way to track the logout timestamp with this endpoint.

Alternatively, you could use the search log events endpoint to find the s (successful login) and the slo (successful logout) event types and programmatically push that information to your MySQL DB.

Please let me know how this works for you.

Thank you.

Hi @spppandey252, not sure if this helps but I just released a detailed guide on how to do this with actions and Morning: Tracking customer logins with Auth0