For the timeout thing, one option would be to store the session id, and the timeout timestamp in the database.
Example:
$session_Delete = time() + (5 * 60);
The session_Delete variable will be a timestamp that is 5 minutes from the current server time.
Store the session_Delete and the session_id in a table. Next setup a script that will run on a cronjob (every 1 minutes is what I use) that will delete any rows with a timestamp less than the current time.
Example:
$curTime = time();
mysql_query("DELETE FROM sessions WHERE Deactivate < '" . $curTime . "'")or die(mysql_error());
Then on the pages you will do a check against the sessions table to see if the session_id is still in there. If it's not, you clear the session and redirect the user to the login screen.
This is the method I have used before and it works just fine, it may not be for you tho : )