if ( (time() - $timestamp) > (60 * 60 * 2) ) { # Do what you need to expire the session }