This is usually caused by the session data file garbage collection running on servers with a lot of session_start() statements and deleting session data files older than the session garbage collection maxlifetime (the default is 1440 seconds.) Garbage collection runs, using the default settings, every 1000 session_start() statements.
If this is on a shared server and someone is using a shorter maxlifetime or more frequent garbage collection run settings, then the shortest/more frequent running will win.
Edit: If this is on a shared server, the best fix for this is to set your own session.save_path so that when gc runs due to other scripts, that your session files don't get deleted.
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.
Last edited by CFMaBiSmAd; 02-03-2007 at 11:33 PM..