ini_set('session.gc_maxlifetime', 3600); session_set_cookie_params(3600, '/'); session_start(); if(!isset($_SESSION['uname'])) { if ($_POST['username'] == 'admin' && $_POST['password'] == 'whfy129') { $_SESSION['uname']= $_POST['username'] . time(); } else if ($_POST['username'] == 'cpe' && $_POST['password'] == 'kakou123') { $_SESSION['uname']= $_POST['username'] . time(); } else { // echo loginform(""); // exit; } } else { $uname = $_SESSION ['uname']; } if ( $_POST['cmd'] == 'logout') { unset($_SESSION['uname']); exit; } ?>