How can developers detect the end of a customer session?

I’m a developer. I’m not sure if there is a sign of the ending of the session when the customer visits the storefront.