I have understood that this is the most effective way to go about this but honestly I don't really understand it.
I have made a chat/ messaging system that stores every message in a database table and displays them on the page ordered by when they were sent.
Now I want to be able to determine if the user has read the message or not. That's why I want to know when the user last left the chat page, so that I can compare that time and date to the time and date stored in the database.
I found a thread where someone wanted to know the time the user spent on a page by i only want to know when the user left.
If you've got a better way to go about this I'm open for suggestions.