This all sounds needlessly complex to me. If you use "normal" PHP session-handling and adjust the values of session.gc_maxlifetime and session.cookie_lifetime (as defined at http://www.php.net/manual/en/ref.session.php), you'll have all the control you need.
Setting the value of session.cookie_lifetime to 0 (zero) will mean the session cookie is active until the user closes his browser, or else you can set it to a specific number of seconds if you want to enforce a maximum cookie lifetime even if the user has not yet closed the browser. The value of session.gc_maxlifetime will determine how long session data will be retained on the server before the automatic "garbage collection" routine is allowed to delete it.
If the user specifically selects a logout option, the following will delete the session cookie and clean up the data immediately (taken directly from the session_destroy() page):
<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
session_start();
// Unset all of the session variables.
$_SESSION = array();
// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
// Finally, destroy the session.
session_destroy();
?>