To avoid a timeout you can increase the timeout period.
You can set the session lifetime in php.ini and runtime using special functions:
http://www.php.net/manual/en/ref.session.php
Note: make sure have a reasonable timeout period set. If you have a busy server and the timeout is 'too long' you will get a huge number of session files on your server, whcih could affect performance.