Well that work's from server side but i need this for client side if that is possible.
...
but i would like to do that with php script or cron over linux ssh.
Which one is it?
The issue that pops up is that meta will do the refresh for you; however, php can't send a header to automatically refresh the page, and what's more, it can only send headers prior to output. So the best it could do is Location headers to refresh the browser.
Sorry to say this, but you're stuck with meta, or you need to rethink your session management. Maybe use a touch system with a database so for each action, the database is touched. If the DB hasn't been touched in over 5 minutes, don't count them as online. Then it's a matter of querying the database for Users touching in the last 300 seconds. At that time you'd also update the database to unset those who are online.
Of course Javascript could easily do this:
function refreshPage() {
window.location("the same page");
}
window.onload = function () {
setTimeout("refreshPage()", 1000*60*5);
}
That will pause for 5 minutes, then refresh your page. Although <meta> tags are much cleaner.