there will be a few changes u need to do to achieve this
first you gotta take away all references to $_COOKIE and replace them with $_SESSION, then change...
setcookie(ID_my_site, $_POST['username'], $hour);
setcookie(Key_my_site, $_POST['pass'], $hour);
you must do this with any references to setcookie()
$_SESSION['ID_my_site'] = $_POST['username'];
$_SESSION['Key_my_site'] = $_POST['pass'];
you will need to change all of these throughout the whole site for it to work correctly.
also i have found that session garbage collection or webservers can be done quite quickly some times, i wud recommend that you create a manual location to store sessions (outside of the root if possible), you do this like so...
ini_set("session.save_path", $_SERVER['DOCUMENT_ROOT']."/sessions"); //sets the save path for the session variables
ini_set("session.gc_maxlifetime", "10000"); //sets the lifetime of the session before it removed.