Hey @carmen_18
Hope you are doing well!
If you are tracking "login=true" flag and "hashed customer ID" in AEP, from web or app properties, you can run queries basis these dimension with date & time. And upon "logout=true" flag with "same hashed customer ID" must be set with date and time. These two flags must be mutually exclusive, while sending a beacon to AEP.
Let me know if I'm missing anything.
Thanks,
Kishore