Detecting dead users
I know there are the event handlers onBeforeUnload and onunload, which work great 90% of the time.
But what would happen if a user who was in the system had a power cut? Would it then be down to the database that stores who is logged in to go through logging users out who havent done anything for a while?
Or could you use the PHP function 'exec' to ping the users IP address and if there is no response, log them off?
You may use a server-side session cookie which expires when the user leaves the site. Should work even if the system has a power cut.
Would my way work though? As the CGI stuff looks very complicated :/
Not more complicated than a client-side solution. But most of the time better:
Originally Posted by imperium2335
So PHP would destroy a session if a user had a powercut or otherwise left the site? I know abit about these so I could use them, but I thought they persisted for a while after the user vanished?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread