PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have to develop a login system where I have track the user login & logout date & time. Now my prob. is if a user just close the browser without logout the how I track that time. Is there any way to track that time. I am using mySQL in as my database.
If its really important, have an invisible image that updates the last time it was loaded in a database, and then have javascript refresh the image every 1 second. In 99% of cases its very unneccessary to do it this way, but I don't really know your situation - so thats how to solve it.
How precise do you want it? You could just run a cron job every minute or so to see whether you have any inactive users (users who may have potentially closed the browser or have no performed any actions in the last X minutes. The problem is what if the user is simply reading an article on your site or something -- and out waited the maximum logout time buffer and logged himself out when he didn't want to.