I think you would need to set a timestamp in the database everytime a page loads and check it against previous timestamps. If the new timestamp is more than 5 minutes old, destroy the session ( [man]session_destroy[/man] ).
But to change the default session life (the time it takes for the server to garbage the session), you would change the php.ini setting for session.gc_maxlifetime to 5 minutes, in seconds.
i.e.
<?php
ini_set("session.gc_maxlifetime", 300);
session_start();
//stuff here
?>