This has the drawback that a new page is loaded after the timeout. Suppose the visitor wants to keep that page in the background and read it in an hour?
You could avoid this by having a session variable with the timestamp of the last page's loading, and update this timestamp on every page. If the timestamp turns out to be too old, kill the session.
Sp wrote:
If you set up the Cookie variable with expiration time with setcookie() or with Header() function from now + timeout and in your page you must get <META .. refresh= xxx.php>. In this php script you must test if the variable is set.