by fhawks » Sat May 19, 2018 11:38 am
I'm running a chatroom that uses PHP and MySQL. I have a user that is, for reasons unknown to me, kind of a phantom user. It is actually my own username. I suspect I was logged into chat at some point when my computer rebooted and for some reason PHP or MySQL (or maybe webserver?) still has the connection or session open and refuses to close it.

What happens is, the phantom will pop into the chatroom, hang around for a couple seconds, then disappear again. This will happen whether or not I'm logged in.

There is a MySQL table that contains the users currently online. I can empty the table or even recreate it, but the phantom user just pops in again.

This happened about 10 months ago and I killed it by deleting my username and creating a new one. Same name, same password, but the phantom went away and didn't come back until a couple days ago. However, obviously, that's not the most desirable method.

tl;dr: How can I kill this phantom session? Is there any way I can, close my database, restart PHP, or my webservice to kill whatever the connection is? I apologize for not knowing much about how servers work.