I need to find a way when a user closes the browser (not a refresh), to make a log entry into a txt file of the date/time logged out. I have a logout function, but it only works if they hit the log out button. I need to be able to run some code to see if a session is destroyed on the server to make a log entry. Users will be frequently logging in/out & I need to record each entry, so a cronjob will not work. I have not found a way in javascript to distinguish between a refresh or a close. I think checking if the session is destroyed & if it is, then make a log entry would be a good train of thought, but I do not know how.
Any suggestions?
Any suggestions?
Comment