i think there is a session time parameter in the php.ini file, but an alternative to that if you don't have access to it, or don't want to globally set it in your config is to just make another session variable.
the logic may look something like this .. it's not tested, and beware, it's still early here 😉
<?
// if last activity is less than 5 minutes ago
if( time() - $_SESSION[lastactivity] < 300 )
{
// update last activity to now
$_SESSION[lastactivity] = time();
}
else
{
// otherwise , send them to some page
// which destroys the session
header("location: expired_page.php");
}
?>