Inva
Printable View
Inva
do you mean something like this
how are u using the php file? thought a webbrowser control or as a script run from the command line?Code:<META HTTP-EQUIV="Refresh" CONTENT="5; URL=pagename.php">
HTTP is a stateless protocol. The only times when there is communication between the client and the server is when the client is requesting something. After that, they disconnect (for all you know, they might keep the connection alive for performance reasons), and the server never knows if the users has left the site or is still looking at it.
A reload meta would do it, except that it disrupts the user's action every 5 seconds. The same in an iframe wouldn't disrupt the user though. But there's no way you can get informed if the user leaves, you can only time him out, and that doesn't take effect until he comes back.
Inva
Have a timer in the VB to send the request every 5 seconds. Then, on the server, if no request has come for ~15 seconds (= what you should allow for bad connections) you "know" that the user has gone away. Only that no script gets executed, but the last timestamp at least still records the last time the user contacted the page. When you get the next request, you can check on this and send the user back to the login.
Of course, this is bad. If I was on a dialup I'd disconnect as soon as I had the page, and I wouldn't want the app try to connect to the net every 5 seconds.